07-21-2009 09:18 PM
07-22-2009 11:02 AM
07-22-2009 12:24 PM
07-22-2009 12:29 PM
07-22-2009 01:46 PM - edited 07-22-2009 01:52 PM
I broke the code down a bit more to make it eaiser. I have excel opening once and I am sending that referance to the other sub vis. I am recieving this error when I attempt to paste values from one workbook to another workbook.
Error -2146827284 occurred at Exception occured in Microsoft Office Excel: PasteSpecial method of Range class failedHelp Path is D:\Program Files\Microsoft Office\Office12\1033\XLMAIN11.CHM and context 0 in Select Select Cell & Paste.vi-
I have also attached a vi which has what I am currently working with.
Its rather simple you choose your range that you wish to copy in table copy, select the sheet and file you wish to paste into (can be the same workbook) and it will paste close everything for you.
07-22-2009 01:52 PM
07-22-2009 03:09 PM
07-22-2009 03:23 PM - edited 07-22-2009 03:25 PM
You're opening a reference to Excel in "Table Copy", passing out that reference, only to open a new one in "Select Worksheet".
I assumed you must open a new referance for every file that you open. But clearly from what your saying it is only needed once.
You didn't include "Quit App", but I wouldn't be surprised if you're opening a new one in there as well.
😃 luckly it is not.
Also, in the "Sample" VI you're calling the subVIs, and passing in empty paths, so they have no workbook to open.
I left the paths empty incase you were to run it which would allow you to select your own files. This is clearly a mistake on my part.
Are you keeping the subVIs open when you're doing this, and trying to set the values of the controls on the subVIs yourself by hand? The values of controls should be set by the parent VI.
No it is filled in automatically. All the values are copied and put in correctly the portion I have an issue with is the actual copying of the information within an excel file.
From what I gather when using excel and labview, once you open a referance you may use that same referance as many times as possible without the need for opening a new one. The only time you must open a new referance is if you were to close it. Correct?
If this is the case I have much work to do on what I have been doing. Now that I have an understanding of the problem I can see why it makes no sense.
07-22-2009 03:50 PM