WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

Errors

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

OLE Server and Extended Syntax

Keywords: 	 3246 OLE Object Object not found

Question:

I used VB4 to create an out-of-process OLE server (*.exe), and I am having trouble using it in WinBatch. Here is a fragment of the WinBatch Code:
   Mail = ObjectOpen("MailWrapper.MabryMail")
   err=LastError( )
   ErrorMode(@cancel)
   if err!=0
   Message("MailWrapper.MabryMail not found","Cannot run this program")
   exit
   endif

   ;Here is where it fails:

   Mail.MailCtrl.NewMessage
   Mail.MailCtrl.To = "ksmiller@pipeline.com"
The error is:
   3246 OLE Object Object not found.
This object does work correctly in VB and Lotus Notes. Any Ideas?

Answer:

I think the problem is that WinBatch can only go one level at a time. Try replacing the offending lines...
   Mail.MailCtrl.NewMessage
   Mail.MailCtrl.To = "ksmiller@pipeline.com"
with:
   MailCtrl=Mail.MailCtrl
   MailCtrl.NewMessage
   MailCtrl.To="ksmiller@pipeline.com"

Question:

I get the 3246: Ole Object Does not exist error when I try to run the following code:
	BoxOpen("Winbatch Automation Example - Excel","Initializing")
	excel = ObjectOpen("Excel.Application")
	workbook = excel.WorkBooks
	worksheet = workbook.worksheets
	excel.visible = @TRUE
	worksheet.cells(1, 1) = "Months"
	Pause ("Excel started", "Excel started")
	ObjectClose(worksheet)
	ObjectClose(workbook)
	ObjectClose(excel)
	Pause ("Excel objects terminated", "Excel objects terminated")
I viewed your topic on the same error and it suggested doing exactly what I did here.

Can you please advise on what I am doing wrong or if this type of object creation is doable with winbatch.

Answer:

Geez. They changed the language again. Must be the Excel consultants full employment act.

Try.

	BoxOpen("Winbatch Automation Example - Excel","Initializing")
	excel = ObjectOpen("Excel.Application")
	excel.visible = @TRUE
	workbooks = excel.WorkBooks
	worksheets = workbooks.Add
	cell=excel.Range("A1")
	cell.Select
	excel.ActiveCell = "month"
	Pause ("Excel started", "Excel started")
	ObjectClose(worksheets)
	ObjectClose(workbooks)
	ObjectClose(excel)
	Pause ("Excel objects terminated", "Excel objects terminated")

Article ID:   W13661
Filename:   3246 OLE Object Not Found.txt
File Created: 1999:04:22:11:31:44
Last Updated: 1999:04:22:11:31:44