LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Error 91 issues.

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.

 

 

 

error 91.png

0 Kudos
Message 1 of 9
(3,783 Views)

The image isn't showing up so I uploaded an attachment.

0 Kudos
Message 2 of 9
(3,779 Views)

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?

0 Kudos
Message 3 of 9
(3,773 Views)

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.higer level snippet.png

0 Kudos
Message 4 of 9
(3,768 Views)

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.

0 Kudos
Message 5 of 9
(3,762 Views)

Did you manage to find a solution to this, cus I'm having the same problem and I need help 😞

0 Kudos
Message 6 of 9
(3,639 Views)

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.

Message 7 of 9
(3,626 Views)

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?

ERROR91.PNG

0 Kudos
Message 8 of 9
(3,606 Views)

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

0 Kudos
Message 9 of 9
(3,582 Views)