Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.
Keywords: Accessing Existing Copy Excel
The reason I am asking is that an application I use generates a temporary excel spreadsheet, opens it and presents it to the User. I would like to put up a button that calls a Winbatch script to do further processing.
My problem is I cannot seem to get to the data using OLE unless I do an ObjectOpen, which creates a new instance; it does not use the existing spreadsheet currently open in excel.
Any advice would be appreciated.
objXL = ObjectAccess("Excel.Application",@true) objXL.Visible = @TRUE objActiveWorkbook = objXL.ActiveWorkbook if objActiveWorkbook == 0 Message("","No active workbook") ObjectClose(objXL) exit endif wrkbkname = objActiveWorkbook.Name Message("Active WorkBook Name",wrkbkname) objActiveSheet = objXL.ActiveSheet if objActiveSheet == 0 Message("","No active workSheet") ObjectClose(objActiveWorkbook) ObjectClose(objXL) exit endif wrkshtname = objActiveSheet.Name Message("Active WorkSheet Name",wrkshtname) ObjectClose(objActiveSheet) ObjectClose(objActiveWorkbook) ObjectClose(objXL)
Article ID: W15623
File Created: 2003:05:13:11:29:18
Last Updated: 2003:05:13:11:29:18