LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

using Active x to control Excel Auto adjust

I would like to know how to turn on the auotmatic cell size adjust feature of Excel so that when I write data to it the cell will expand if the data is bigger than the current cell size.
0 Kudos
Message 1 of 4
(3,745 Views)
Hello Gallen,

To change the setting in Excel for AutoFit the text in a cell, you need to call the Property Node for Column and then a Invoke Node for AutoFit. I am attaching a example program that does performs this task. The original program was "Using LabVIEW and ActiveX to Perform Basic Tasks In Microsoft Excel".

I hope it helps,
Rajiv
0 Kudos
Message 2 of 4
(3,745 Views)
I am a C programmer I don't even know how to use Labview. Is there any C code out there that might help? I am not very familiar with active X.

Greg Allen
0 Kudos
Message 3 of 4
(3,745 Views)
Hello Greg,

Sorry about the confusion. To use the AutoFit in CVI I think you can use the command RangeAutoFit (that is part of the Excel ActiveX Library) to automatically re-size the columns for the text. The other option would be creating a macro in Excel and calling that from CVI.

You can find an example program for using Excel ActiveX in CVI at Controlling Microsoft Excel for Office 2000 with an ActiveX Automation Server.

I hope this helps,
Rajiv
0 Kudos
Message 4 of 4
(3,745 Views)