AnsweredAssumed Answered

vrf ESG waveform download

Question asked by VRFuser on May 20, 2004
Hello everybody,

I've got the following problem and I hope somebody can help me:

I want to control an Excel application out of Vee using ActiveX.
I create the application (set my global variable "App", which points to ExcelApplication), make it visible and open an existing Excel file (set my global variable "Book", which points to the workbook). After that I display a Vee "Save" button to prevent Vee from going any further in its program flow. The user is supposed to enter data into the Excel sheet and press the "Save" button afterwards and then Vee is going to save the Excel Workbook and close/quit Excel.
As long as the user doesn't enter any data it works perfectly. But as soon as he does, I loose control over the Application/Workbook. That means my global Vee variables (Book, App), still point to the same address, but the type/object info is set to "null" (if I look at App for instance, it gives me something like: "(null)(0x0021f914)") and if I attempt to access the "SaveAs" method of "Book" then I get the error message: "SaveAs" is not a member of the referenced ActiveX object".

I'm using Vee 6.01, Excel 2000 and the Microsoft Excel 9.0 Object Library and I have the following code:

In a formula with input "filename":
set App=CreateObject("Excel.Application");
App.Visible=True;
App.Workbooks.Open(filename);
set Book=App.ActiveWorkbook;

The I call the "Save" button

In a formula with input "filename":
Book.SaveAs(filename);
App.Quit();

Thanks for the help.

Kind Regards
Torsten

---
You are currently subscribed to vrf as: rsb@soco.agilent.com
To subscribe send a blank email to "join-vrf@it.lists.it.agilent.com".
To unsubscribe send a blank email to "leave-vrf@it.lists.it.agilent.com".
To send messages to this mailing list,  email "vrf@agilent.com". 
If you need help with the mailing list send a message to "owner-vrf@it.lists.it.agilent.com".

Outcomes