LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Excel, add sheets to a Workbook using .net

Solved!
Go to solution

@Bob_Schor wrote:

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


When ActiveX goes bye-bye in Excel 20xx, there will be a lot of unhappy people.

 

 

I am still waiting for an answer from the OP for this so-called .NET framework for interfacing LabVIEW and Excel.

 

 

 

 

0 Kudos
Message 11 of 19
(2,788 Views)

@Darin.K wrote:

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.


Wow, talk about non-intuitive! Kudos!

 

Ben64

0 Kudos
Message 12 of 19
(2,783 Views)

I am having difficulties implementing your instructions.

How do I select “static”?

0 Kudos
Message 13 of 19
(2,749 Views)
Solution
Accepted by topic author DM83

I followed Darin's instructions and easily found this (in System, which Darin forgot to mention, but I guessed):

Missing Property Node.png.  I'm not sure what Darin meant by (static), but it may have something to do with the fact that the Property was (as I recall) listed as [S]Missing (but appears in the alphabetic list as though the [S] isn't there, so it is between MetaDataToken and Module).

 

Bob Schor

Message 14 of 19
(2,737 Views)

I was also able to find “Type” in system as per my previous screen shot, just I miss interpreted the language of the instruction after that. I was looking for “a” missing property called static instead of “the” (Static) Missing property.

 

Anyway it is working now thanks.

Message 15 of 19
(2,727 Views)

So, how do we set the range of cells to write to before we are able to do it using the Value2 Property? I have been able to write only to one cell, using UsedRange so far. But I want to write a whole 2D table, of course.

0 Kudos
Message 16 of 19
(2,592 Views)

OK. I figured it out. We can invoke get_Range method on the Cells property of the worksheet to set the range of cells. Microsoft tells to use Range property instead (https://msdn.microsoft.com/en-us/library/microsoft.office.tools.excel.worksheet.get_range%28v=vs.120...) but I don't see it for Worksheet in LabVIEW.

0 Kudos
Message 17 of 19
(2,587 Views)

Actually, no need to get Cells property of worksheet at all. The Worksheet itself has get_Range method. So, here is yet another,  simpler version.

0 Kudos
Message 18 of 19
(2,585 Views)

Gotta be good boys and close all the references. You can wire any table data to the variant input. The 'To .Net Object.vi' doesn't like array ov variants though. With ActiveX Automation the Value2 itself was of variant type and accepted a 2D array of variants just fine and you can wire any 2D array when calling a VI with a 2D array of variants as a terminal.

0 Kudos
Message 19 of 19
(2,566 Views)