XlWrkBkDotNet := XlWrkBkDotNet.XLWorkbook(MemoryStream);
i := 1;
EndOfLoop := XlWrkBkDotNet.Worksheets.Count;
WHILE (i <= EndOfLoop) AND (NOT Found) DO BEGIN
XlWrkshtsDotNet := XlWrkBkDotNet.Worksheet(i);
IF SheetName = XlWrkshtsDotNet.Name THEN
Found := TRUE;
i := i + 1;
END;
IF Found THEN
XlWrkShtDotNet := XlWrkBkDotNet.WorksheetString(SheetName)
ELSE BEGIN
CLEAR(XlWrkBkDotNet);
END;
For DotNet Variables XlWrkShtDotNet, XlWrkBkDotNet etc, you need to use ClosedXML.Excel.XLWorkbook assemblies
Answers
Activate the debugger and show us where it stops.
ClientTempFileName := ThreeTierMgt.ClientTempFileName(PathRTC.GetExtension(FileName));
FileRTC.Copy(FileName, ClientTempFileName);
UPLOADINTOSTREAM('',ThreeTierMgt.Magicpath,'',ClientTempFileName,NVInStream);
MemoryStream := NVInStream;
XlWrkBkDotNet := XlWrkBkDotNet.XLWorkbook(MemoryStream);
i := 1;
EndOfLoop := XlWrkBkDotNet.Worksheets.Count;
WHILE (i <= EndOfLoop) AND (NOT Found) DO BEGIN
XlWrkshtsDotNet := XlWrkBkDotNet.Worksheet(i);
IF SheetName = XlWrkshtsDotNet.Name THEN
Found := TRUE;
i := i + 1;
END;
IF Found THEN
XlWrkShtDotNet := XlWrkBkDotNet.WorksheetString(SheetName)
ELSE BEGIN
CLEAR(XlWrkBkDotNet);
END;
For DotNet Variables XlWrkShtDotNet, XlWrkBkDotNet etc, you need to use ClosedXML.Excel.XLWorkbook assemblies