LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

trying to print range of cells from front panel ActiveX Excel container

I am trying to print a range of cells from a front page container which has an excel spreadsheet as its object.  Having spent quite a while scouring the board, I found a procedure posted by Michael M...shown below.

 

 

2) from the worksheet ref wire:
property node PageSetup
cascade property node PrintArea, change to write
feed in your range as a string value

 

I tried to follow this procedure, but I get an error every time I run the VI and click on the Save Standard button (whose event executes this code). 

 

Can anyone tell me what I'm doing wrong?

0 Kudos
Message 1 of 5
(2,602 Views)

It looks like you might be specifying your print area range incorrectly.  It looks like you are using "A3 - J" or something like that.  You will need to express the range using something like "A3:J3", or "A3:J10" - upper left cell + ":" + bottom right cell.  Try that.

-cb

0 Kudos
Message 2 of 5
(2,596 Views)
You didn't indicate what the error was, but I'd bet it's at the Variant to Data in your circled region. The front panel ActiveX control that you're using is not an Excel workbook, or anything else related to Excel. It's a totally different control from Microsoft. Thus, you cannot cast it/convert it to an Excel worksheet, or anything related to Excel.
0 Kudos
Message 3 of 5
(2,594 Views)

Actually smercurio, the error occurs right at the PrintArea property node, and the error message does seem to indicate what you alluded to. The error is shown in the attached file.  I used the same type input to the Variant to Data earlier in the application, with great success.  I've shown that portion of the code as well.  Can you explain what I'm doing wrong in more detail?  I see that I should have used a different type input to the Variant to Data node, but now I can’t seem to get where I’m going from here.  I also included a screen shot of the code I have so far, now that I’ve changed that input.  I'm sure I have the right type input to the Variant to Data...I think.

0 Kudos
Message 4 of 5
(2,577 Views)
It works in the code you show at the top because that's dealing with Excel. As I said, the ActiveX control that you're using is a totally different beast, and has a different object model. As far as I know, the Spreadsheet control that you're using has no PageSetup, but you should check the MSDN site as you should be able to find the documentation for that control there.
0 Kudos
Message 5 of 5
(2,573 Views)