Im running Winbatch 2004A , and Windows 7, and MS Excel 2010
; This code assumes the XLS column data constant
xlsFilename = AskFilename( "Excel Dialog Example", "C:\test\", "XLS Files|*.XLS|XLSX Files|*.XLSX", "C:\test\MyExcelFile.xls", 1 )
objExcel = ObjectCreate("Excel.Application")
objExcel.Visible = @TRUE
objExcel.Workbooks.Open(xlsFilename)
I get error "3052 - uninitialized variable or undifined function" on line objExcel = ObjectCreate("Excel.Application")
My goal is to read cells from an excel spreadsheet. Is this version of Winbatch not able to do this using the above method ? How would you suggest achieving this goal of mine ?
Thank you,
Joe
The 'ObjectCreate' function is not available in your 10 year old version of WinBatch. It first appeared around version 2004F or there abouts. You will need to use 'ObjectOpen' instead.
Thank you ! The following seems to work. But now it crashes with " Error 1258: OLE Unknown name " at the line with arrow. How do I find the Objects Properties and Methods of the Object ? I can't determine if winbatch is disagreeing with the "Workbooks" or "Open" or ?? Where are these values listed at ?
objExcel = ObjectOpen("Excel.Application")
;objExcel = ObjectCreate("Excel.Application"
objExcel.Visible = @TRUE
objExcel.Workbooks.Open(xlsFilename) <-----------
Thanks again !
Joe
Your old version of WinBatch does not support multiple member via the dot notation. So you need to change
objExcel.Workbooks.Open(xlsFilename)
to
objWorkbooks = objExcel.Workbooks
objWorkbooks.Open(xlsFilename)