A
alexander chupeev
I can use the following statement in Visual Basic.NET application to refer a
row in Excel spreadsheet:
Imports Excel = Microsoft.Office.Interop.Excel
....
Dim wst as Excel.Worksheet = app.ActiveSheet
wst.Rows(2).Locked = True
I need your help to automate Excel the same way with Visual C++. The Rows
property of Excel::Worksheet object cannot be used in array context in C++,
so I suppose that the following piece of code will be equvalent to previous
one:
#import "C:\Program Files\Microsoft Office\Office11\Excel.exe" \
auto_search auto_rename dual_interfaces exclude("IFont", "IPicture")
....
Excel::_WorksheetPtr wst = app->ActiveSheet;
wst->Rows->_Range[2L][vtMissing].Locked = VARIANT_TRUE;
^?????
The last line always throw a runtime exception
row in Excel spreadsheet:
Imports Excel = Microsoft.Office.Interop.Excel
....
Dim wst as Excel.Worksheet = app.ActiveSheet
wst.Rows(2).Locked = True
I need your help to automate Excel the same way with Visual C++. The Rows
property of Excel::Worksheet object cannot be used in array context in C++,
so I suppose that the following piece of code will be equvalent to previous
one:
#import "C:\Program Files\Microsoft Office\Office11\Excel.exe" \
auto_search auto_rename dual_interfaces exclude("IFont", "IPicture")
....
Excel::_WorksheetPtr wst = app->ActiveSheet;
wst->Rows->_Range[2L][vtMissing].Locked = VARIANT_TRUE;
^?????
The last line always throw a runtime exception