From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Error 2147023170 occurred at Remote procedure call failed at Excel copy worksheet.vi.

Hi,

I'm using a downloaded excel vi library (including excel_open.vi, excel_copy.vi and excel_close.vi) to programmatically insert my data into a template worksheet inside an excel workbook. However, I keep getting "Error 2147023170 - Remote Procedure Call Failed" from LabVIEW, followed by a tremendous series of dialog boxes generated by Microsoft office before I end Excel in task manager.

I'm confused by the source of this error. There were times when this error only occurred when I had other excel workbooks open while running the program. There were also times when it occurred for no reason. And sometimes it works just fine...

Is there a consistent reason why this happens so that I could avoid in the future, such as some settings in excel or location of the file? Or has this something to do with my downloaded library (I can't remember exactly where I downloaded it, possibly from the discussion forum)?

Relevant code attached.

Thanks for your help in advance.

Download All
0 Kudos
Message 1 of 6
(3,928 Views)

Hi,

 

I have been unable to open and use the .VIs posted due to missing files. There is no library that holds the global variables so I am unable to run the vi. Is it possible to upload your project?

 

Have you got a screenshot of the error message that you receive?

In which VI does the error occur?

 

If you can find where you "downloaded it, possibly from the discussion forum" this will be helpful to future troubleshooting.

 

 

 

Thanks,

Amy

0 Kudos
Message 2 of 6
(3,881 Views)

Hi Filip, the report generation toolkit handles a lot of the functionality you will need to create Excel workbooks. I believe it started coming included with LabVIEW in 2012 or so.

0 Kudos
Message 3 of 6
(3,874 Views)

@Gregory wrote:

Hi Filip, the report generation toolkit handles a lot of the functionality you will need to create Excel workbooks. I believe it started coming included with LabVIEW in 2012 or so.


The Report Generation Toolkit is included with the Professionnal version, it is still an add-on you have to buy for the basic and full versions.

 

Ben64

0 Kudos
Message 4 of 6
(3,871 Views)

Hi Amy,

 

Sorry for the late reply. I've uploaded the project which is tailored in a way that only the parts relevant to excel generation remain. Ignore the VIs I uploaded last time.

 

In order to see the outcome of the program:

 

1.Create an excel workbook. Rename a worksheet "Template New" which is to be used as a template.

2.Open Main.vi. Enter Excel workbook Path and New Sheet Name/Existing Sheet Name. ( Enter New Sheet Name to create a new report with the name specified; Enter Existing Sheet Name to modify an existing report.Other inputs are just data to be fed into the report. Could leave them empty.)

3.Run Main.vi. Wait for the Excel report to be generated and show itself.

 

Other information I have is :

1. The error message is usually as the name of the question under the title of "undefined error". Sometimes 

2. As I said, sometimes it generates tons of error messages by Microsoft Excel after this error message by labVIEW.

3. Every time I open one of the VIs in the excel library and close it without any change, there is a dialog box saying “xx.vi has unsaved changes, do you want to save them..."

 

If you have any idea what caused the problem that would be really helpful.

Thank you in advance!

 

 

0 Kudos
Message 5 of 6
(3,859 Views)

Thanks for the reply.

I've already used the toolkit as part of my code, but only to find some of my desired functionalities could not be achieved with the toolkit alone. So that I added something else from the downloaded excel library.

I've uploaded the relevant part of my project so that the result could be seen. 

 

0 Kudos
Message 6 of 6
(3,855 Views)