06-07-2012 11:25 AM
I am in need of help. I have inherited a large program that isn't entirely working and have been tasked to figure out why and fix the problem. I have a total of 2 weeks of LabVIEW experience so there is the possibility that this might be a simple fix. From what I can understand with this part of the program is that it is taking an Excel worksheet then adding another sheet and copying the template to that added sheet and populating the data. When ever I run this program and watch the signal path the error 91 generates at the Variant to Data node and the error window says this: "Variant To Data in Copy Excel Worksheet.vi". Below I have attached a snippet of the code to aid visually. Could anyone help me understand why I am getting this error. Because: "The data type of the variant is not compatible with the data type wired to the type input" isn't helping me much.
|
06-07-2012 11:38 AM
The image isn't showing up so I uploaded an attachment.
06-07-2012 12:10 PM
Unfortunately, it's impossible to tell you what the problem is since you only show the specific subVI, and it has the sheet ActiveX object as a front panel control. Thus, you'd need to show the higher level code. Have you verified that you are wiring the correct ActiveX class to the "Excel._Worksheet2" control? What value are you specifying for the string control? A sheet name or a sheet index?
06-07-2012 01:18 PM
Unfortunately this attachment is the highest level I will be allowed to show so if this is still not enough I understand and thank you for your input. This snippet is inside of the Copy Excel Worksheet.vi which is under the Write Report.vi. And the sub vi's to the left and right are Generate Report Get Data to Modify.vi and Generate Report Set Modified Data.vi respectively. So what I understand is we are taking a template and then populating it with data from tdms file that was output by a test that is conducted. Then we are trying to generate a report of all previous tests. The program is poorly annotated and the person who created this program no longer works with us so the information I have on this code is based on what I can understand. I appreciate your help! I also attached the same image incase it does not show.
06-07-2012 01:31 PM
Also to help with the string data labeled template I used "To Variant" to match the data type into index. I still get the error 91 coming out of the Variant to Data going into the Worksheet invoke node. If that helps the troubleshooting.
10-17-2012 04:06 AM
Did you manage to find a solution to this, cus I'm having the same problem and I need help 😞
10-17-2012 08:06 AM
Yes I managed to find out that Instead of wiring from the "invoke method Item" to the "after" option of the "invoke method copy". I had to branch of from the data port of the "variant to data" and then put it through a "to Variant" converter and wire it into the "after" option of the "invoke method copy". Hope that helps.
10-17-2012 09:04 PM
I'm trying to create a simple login vi that gets and verify userID and password from Microsoft Access DB but I get error 91. Can you help me solve this please?
10-18-2012 11:12 AM
tingy,
I found this document that outlines one reason you might be getting this error. http://digital.ni.com/public.nsf/allkb/93741A4F84317884862574F8005E3934
It could be that the amount of data you are attempting to transmit is greater than the amount that Microsoft Access is set to handle. The suggested solution is to limit the number of bytes that you are transmitting at one time.
Leah