LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

XP versus Vista for writing Excel files

I used to dump my data into an Excel file and save it to a user input location. In the process Labview used to open MS Excel, write the data, save and close the file, close MS Excel. Since the data is large enough, you could actually see these steps happening sequentially.
 
Unfortunately new upgrades to the system has made me moved to Vista and the same code does not work.
 
1) data is being collected
2) i have a debug popup box which shows me the count of # of data points - this count is also correct confirming all the data is collected
3) MS Excel opens
4) --- nothing after this step.
 
New workbook is not opened, data is not written, file is not saved.
 
MS Excel is closed.
 
Can somebody give me some pointers on how to debug this issue? Is it related to teh OS?
 
I have Vista Home Premium, SP 1.0 and Microsoft Office 2003.
 
Thanks in advance.
0 Kudos
Message 1 of 16
(4,189 Views)
Here are the print screens of the VI:
 
0 Kudos
Message 2 of 16
(4,184 Views)
This is the reason that I do not writing directly to excel. Microsucks can change anything that they want and break everything without telling you. I would suggest writing to a delimited text file and then importing that into excel later.

For more information and some sample VI's and tool kits, you can go to the excel board



Joe.
"NOTHING IS EVER EASY"
0 Kudos
Message 3 of 16
(4,165 Views)

Writing to text and reading into an Excel file is not an option, because in a month the setup my collection about 500 data sets and it would be tedious to import each one into Excel. The only solution is to dump it into Excel directly so I have to fix this VI. Anybody else has any idea where and how do I debug? Since there is no error being thrown at me, it is hard to even start debugging.

Thanks.

0 Kudos
Message 4 of 16
(4,145 Views)
This is really a microsoft thing. I would check the versions of Excel. Make sure that they did not change the functionality of a specific function. I would start the debugging by slowly commenting out code and seeing exactly were it is breaking at. this is going to be kind of a bear to debug. i would really suspect that it is a Vista thing and not Excel or LV.



Joe.
"NOTHING IS EVER EASY"
0 Kudos
Message 5 of 16
(4,142 Views)

I should take back my statement that no error is being thrown at me. Follow in the error that the VI is hitting:

 

Exception occured in Microsoft Office Excel: '' could not be found. Check the spelling of the file name, and verify that the file location is correct.

If you are trying to open the file from your list of most recently used files on the File menu, make sure that the file has not been renamed, moved, or deleted.Help Path is C:\Program Files\Microsoft Office\OFFICE11\1033\xlmain11.chm and context 0 in Open New  WorkBook.vi->Individual_Excel_Files_SUBVI_New_G34.vi->LLCR_Antares_Fixture.vi

 

But the problem is still the same - the exact same code worked in XP but is throwing this exception in Vista.

Thanks.

0 Kudos
Message 6 of 16
(4,127 Views)

In vista the file system is different. so this error may be correct in that it cannot find Excel. try opening up the open Excel and make visible vi and right click on the automation refnum. Then select active X class/ browse. Then find the Microsoft Excel object library (the latest one) and then select application. You may be trying to link to another version of the class. Try this in a new vi and see what happens. First do the open Excel and make visible only and if that works start adding in vi's one at a time to see where it breaks.

 

 

 




Joe.
"NOTHING IS EVER EASY"
0 Kudos
Message 7 of 16
(4,123 Views)

I'm having the EXACT same problem, and I don't see any solution posted here. I posted on the Excel forum and was told to come back HERE. I verified that I'm using the correct versions of Excel and Labview with Vista. I have no error messages. If I try to overwrite an existing file, I get prompted asking if I want to overwrite, and I indicate yes, and the existing file is deleted, but no new file is written. A colleague here says he has the same problem but OCCASIONALLY has success in writing the Excel file with Vista (same computer). Any help here?

0 Kudos
Message 8 of 16
(3,468 Views)

It seems your problem is that you cannot even write to an Excel file using ActiveX.

 

If it was me, I'd try to do is using Visual Basic Express. Nothing fancy. Just a few lines of code to save data to an Excel file.  http://support.microsoft.com/kb/301982

You probably have an issue that is Windows Vista related.

 

 

 

0 Kudos
Message 9 of 16
(3,464 Views)

It IS Vista related since I have no problem running this on XP. I'm using LV 2011 and the Labview MS Office Toolkit 2011 and Excel 2007, as shown here http://digital.ni.com/public.nsf/allkb/C9408B9F08D711E786256F3300701D01

It would appear to me that if I'm consistent with these guidelines  the  MS Office Toolkit should work with Vista.

0 Kudos
Message 10 of 16
(3,454 Views)