madiator Posted June 6, 2008 Share Posted June 6, 2008 (edited) Hello, How can I create an $oExcel Object from an already opened Excel-Workbook? Currently the ExcelCom_UDF seems to suppport the object creation only by creating a new workbook or opening one. Background: A few weeks ago, I programmed a Script which makes some Excel calculations. This Script seems to work pretty good. Now I have a new requirement: The calculation should be generated right before saving the Excel-Sheet. My currently planned solution: Create a small "execute before Save" Makro in Excel which executes the script. This requires the possibility to work with the already opened Excel-Workbook. Emergency-plan: Completely rewrite the Script in VBA. Disadvantages: Additional time effort, VBA and me are not best friends. Edited June 6, 2008 by madiator Link to comment Share on other sites More sharing options...
madiator Posted June 6, 2008 Author Share Posted June 6, 2008 OK. First thinking then writing: I tried to create an new Object via ObjCreate, since the Excel-Object have allready been created creating the Object via ObjGet has been more useful. In the case that some others started breaking their heads: Thank you very much. Link to comment Share on other sites More sharing options...
PsaltyDS Posted June 6, 2008 Share Posted June 6, 2008 (edited) How can I create an $oExcel Object from an already opened Excel-Workbook? Currently the ExcelCom_UDF seems to suppport the object creation only by creating a new workbook or opening one. Not so: #include <ExcelCOM_UDF.au3> $oExcel = _ExcelAttach("C:\SpreadSheets\Test.xls", "FilePath") Edited June 6, 2008 by PsaltyDS Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now