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: 

Excel, add sheets to a Workbook using .net

Solved!
Go to solution

The “add” “sheets” method is generating error 1172 on Excel 2010.

Is there a way to resolve this?

0 Kudos
Message 1 of 19
(6,859 Views)

If you have the Report Generation Toolkit (included with Base LabVIEW starting with LabVIEW 2014), the Excel Add Worksheet function just works.  Here's an example and the WorkBook it produces:

WorkSheet Example.pngWorksheet.png

 

Bob Schor

0 Kudos
Message 2 of 19
(6,840 Views)

Thanks for looking at my issue,

I already have working programs using ActiveX and I agree that I could also use the report Generation Toolkit.

 

However, I want to see what a .net version of the code would look like for comparison.

So what I am really looking for is a way to make the .net method work.

0 Kudos
Message 3 of 19
(6,829 Views)

Can you save vi for lv2011?

0 Kudos
Message 4 of 19
(6,807 Views)

@DM83 wrote:

The “add” “sheets” method is generating error 1172 on Excel 2010.

Is there a way to resolve this?


What does using .NET mean?

 

Where is the .NET code that you are referring?

 

 

0 Kudos
Message 5 of 19
(6,798 Views)

Here is LabVIEW 2011 version and code snippet.

Download All
0 Kudos
Message 6 of 19
(6,778 Views)

I am not writing .net code, I understood ActiveX or .net to be frameworks and in this context an interface between LabVIEW and Excel.

 

I am currently using ActiveX to programmatically open excel and write data directly into the spreadsheet.

 

Here is a working ActiveX version for comparison.

Download All
0 Kudos
Message 7 of 19
(6,769 Views)

@DM83 wrote:

I am not writing .net code, I understood ActiveX or .net to be frameworks and in this context an interface between LabVIEW and Excel.

 

 


Again, where is your "understanding" coming from???  From what source are you getting your information?

 

 

 

 

 

0 Kudos
Message 8 of 19
(6,747 Views)

From Wikipedia (regarding ActiveX):

 

Despite Microsoft's previous efforts to make ActiveX cross-platform, most ActiveX controls will not work on all platforms, so using ActiveX controls to implement essential functionality of a web page restricts its usefulness. Countries like South Korea have started to remove this technology from their public websites in order to make their web site accessible to more platforms.[12]

Microsoft dropped ActiveX support from the Windows Store edition of Internet Explorer 10 in Windows 8. In 2015, Microsoft Edge, the replacement for Internet Explorer, dropped ActiveX support, marking the end of the technology in Microsoft's web browser development.[13]

 

Bob Schor

0 Kudos
Message 9 of 19
(6,729 Views)
Solution
Accepted by topic author DM83

You need to supply Type.Missing to the optional parameters in the Add Sheets method.  Drop a Property Node and browse to select class Type in mscorlib, then choose the Missing property (static).  Wire this property to the unwired optional inputs.

Message 10 of 19
(6,722 Views)