workbook and application reference set to null after the user enters something in an excel sheet

T

Tobias

Hello All,

I've got the following problem: I'm trying to control an Excel
Application using ActiveX (out of Agilent-Vee).
I create the application, open an Excel file and make it visible. The
user is supposed to enter data in the sheet and after that has to push
a button (its a vee button) and the workbook is saved (out of vee). It
works perfect as long as the user doesn't enter any data. As soon as
he does the references to my workbook and application are set to Null
and I'm not able to save it anymore. I get the message "SaveAs" is not
a member of the referenced ActiveX object (which will bee the
reference to the workbook).

The code (entered in Vee Formulars, but i think i doesn't matter):

set ExcelApp=Createbject("Excel.Application");
ExcelApp.Visible=True;
ExcelApp.Workbooks.Open(filename);
set ExcelBook=ExcelApp.ActiveWorkbook;

then I call the "save" button

if the button is pressed:

ExcelApp.SaveAs(filename);
ExcelBook.Close();
ExcelApp.Quit();

ExcelApp and ExcelBook are global variables.

I hope somebody can help me here - thank you very much.

Tobias
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top