08-11-2006 09:31 AM
08-14-2006 10:53 AM
I wonder if it has to do with opening a .txt file. If I manually try to save a workbook that was opened as a .txt file, I get the message "The selected file type does not support workbooks that contain multiple sheets ...To save only the active sheet click OK... " I would try the same code, but start by opening a simple one-worksheet .xls workbook file.
Your check of the number of worksheets leads me to think that you have the right parent-child relationship between application, workbook and worksheets. But double check that you create the instances of each object in the right order. i.e do they follow the relationship shown in the code below?.:
ExcelRpt_ApplicationNew (VTRUE, &Excelxp_handle);
ExcelRpt_WorkbookNew (Excelxp_handle, &wb_handle);
ExcelRpt_WorksheetNew (wb_handle, 1, &ws_handle);
I assume that you have the version of Excel installed that matches the object model your instrument (.fp).
More on object model versions here: http://forums.ni.com/ni/board/message?board.id=180&message.id=18825&requireLogin=False
More on object models here: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dv_wrcore/html/wrconexcelobjectmode...
Hope this helps. Please let us know what you find.
--Ian
08-16-2006 03:40 AM
Hello Ian,
you give me the right suggestion!
I just called the "ExcelRpt_WorkbookSave" function with a different File Format (ExRConst_Excel9795 instead of ExRConst_DefaultFileFormat) and now everythink works as I want.
Thank you for your help!
baloss