View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Tobias[_3_] Tobias[_3_] is offline
external usenet poster
 
Posts: 1
Default workbook and application reference set to null after the user enters something in an excel sheet

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