Hi Everyone,
Can you please!
What am I doing wrong?
ExcelBuf.OpenBook_NAS2(FileName); - GOOD
Error in the function ExcelBuf.OpenSheet_NAS2("Template Sheet Name");
OpenSheet_NAS2(SheetName : Text[30])
i := 1;
EndOfLoop := XlWrkBkRTC.Worksheets.Count;
ERROR
A call to System.__ComObject.get_Count failed with this message: The type of one or more arguments does not match the method's parameter type.
WHILE (i <= EndOfLoop) AND (NOT Found) DO BEGIN
XlWrkShtRTC := XlWrkBkRTC.Worksheets.Item(i);
ERROR
A call to System.__ComObject.get_Item failed with this message: The type of one or more arguments does not match the method's parameter type.
IF SheetName = XlWrkShtRTC.Name THEN
Found := TRUE;
i := i + 1;
END;
IF Found THEN
XlWrkShtRTC := XlWrkBkRTC.Worksheets.Item(SheetName)
ELSE
ErrorExcelProcessing(STRSUBSTNO(WorksheetNotFoundErr,SheetName));
Help me, please!!!
0
Answers
...change it to...
...obviously you'll need a new variable for XlWrkShtsRTC to hold the Excel Worksheets (plural)
Kishorm
I Wrote
i := 1;
//EndOfLoop := XlWrkBkRTC.Worksheets.Count;
XlWrkShtsRTC := XlWrkBkRTC.Worksheets;
EndOfLoop := XlWrkShtsRTC.Count;
new variable XlWrkShtsRTC = Microsoft.Office.Interop.Excel.Worksheets.'Microsoft.Office.Interop.Excel, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c'
New Error
Message: System.__ComObject.Count: Object does not match target type.
forum.mibuso.com/discussion/62541/excel-interop-runonclient-no
Franz Kalchmair, MVP
Alias: Jonathan Archer
please like / agree / verify my answer, if it was helpful for you. thx.
Blog: http://moxie4nav.wordpress.com/
All dotnet variables have runonclient = no
Thanks for the info.
I have installed a language pack, but the error remained.
It is a horror ((((