LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Excel insert Graph VI error

Hello everyone,

 I am trying to separate the report generation portion of a software that I am working on but I am experience an issue with the graph shapes node. Let me give you a quick history of the thing..   The software is working properly when it is in the original shape ( part of a big software that been outsourced). after I did separate the report generator portion of the software I was able to run and generate a full report for one time only then after that the VI runs OK until it come to the point of insert a graph. so the excel file created and all sheets were created correctly and when it get to the graph shapes node a message pop up saying excel stop working and the LabVIEW gives me this error " Error -2147023170 occurred at The remote procedure call failed.
 in NI_Excel.lvclass:Excel Insert Graph.vi->Create Excel Report.vi->Write Summary Sheets.vi->ReportZ.vi

This error code is undefined. Undefined errors might occur for a number of reasons. For example, no one has provided a description for the code, or you might have wired a number that is not an error code to the error code input.

Additionally, undefined error codes might occur because the error relates to a third-party object, such as the operating system or ActiveX. For these third-party errors, you might be able to obtain a description of the error by searching the Web for the error code (-2147023170) or for its hexadecimal representation (0x800706BE).". I appreciate your time and consecrations.

0 Kudos
Message 1 of 8
(2,818 Views)

According to this article, the issue occurs due to multiple ActiveX calls in quick succession and suggests leaving a 50ms delay between calls (ie. in your for loop).

http://digital.ni.com/public.nsf/allkb/666386AA5FCAD23086256CED00810C23?OpenDocument

0 Kudos
Message 2 of 8
(2,799 Views)

Thank you. I


@McQuillan wrote:

According to this article, the issue occurs due to multiple ActiveX calls in quick succession and suggests leaving a 50ms delay between calls (ie. in your for loop).

http://digital.ni.com/public.nsf/allkb/666386AA5FCAD23086256CED00810C23?OpenDocument



added this 50ms but still having the same issue

0 Kudos
Message 3 of 8
(2,794 Views)
0 Kudos
Message 4 of 8
(2,790 Views)

I can confirm that doing multiple calls to Excel-specific RGT functions can cause strange Error conditions that are cured with a brief delay following the function.  Two places I've used it is to place a 100 ms delay between Save Report to File and Dispose Report and an additional 500 ms delay after Dispose Report (when I'm processing multiple Workbooks in a For Loop).  I haven't done a test to find the "minimum value" for these delays -- in the context of the data processing, an "idle second" is no big deal compared to a crash for "no good reason", especially when someone else is running the program.

 

Bob Schor

0 Kudos
Message 5 of 8
(2,788 Views)

@McQuillan wrote:

Can you upload your code?


I do not think I can upload the hole codes.

0 Kudos
Message 6 of 8
(2,780 Views)

@Bob_Schor wrote:

I can confirm that doing multiple calls to Excel-specific RGT functions can cause strange Error conditions that are cured with a brief delay following the function.  Two places I've used it is to place a 100 ms delay between Save Report to File and Dispose Report and an additional 500 ms delay after Dispose Report (when I'm processing multiple Workbooks in a For Loop).  I haven't done a test to find the "minimum value" for these delays -- in the context of the data processing, an "idle second" is no big deal compared to a crash for "no good reason", especially when someone else is running the program.

 

Bob Schor


Thank you, Can you please use my snip shoots and tell me where to add these delays? Please

0 Kudos
Message 7 of 8
(2,779 Views)

I can do it if you show it to me.  I see a (tiny?) piece of code that has three functions on it, neither of which I would think would cause a problem.

 

Here's what you should do -- copy the VI that you are showing as a picture -- call it "My Example" or something.  Delete everything except anything that uses the Report Wire, then get rid of all the "blank" spaces.  You should end up with a few functions that start with New Report and possibly end with Dispose Report (I don't know how you end the Report).  Then attach this VI -- if you post a picture, I won't look at it, as it doesn't give me enough information to understand fully what you are trying to do.

 

Bob "No Pictures, Please" Schor

0 Kudos
Message 8 of 8
(2,777 Views)