10. September 2009 08:37
10. September 2009 08:43
10. September 2009 09:10
10. September 2009 11:16
NumberOfSheets := ExcelBuf.NumberOfSheetsInWorkbook(FileName);
i := 1;
IF 1 = 1 THEN;
WHILE i <= NumberOfSheets DO BEGIN
SheetName := ExcelBuf.SelectMultiSheets(i);
ExcelBuf.OpenBook(FileName,SheetName);
ExcelBuf.ReadSheet;
DatenAnalysieren();
i +=1;
END;
NumberOfSheetsInWorkbook(FileName : Text[250]) : Integer
IF NOT ISSERVICETIER THEN BEGIN
IF NOT EXISTS(FileName) THEN
ERROR(Text003,FileName);
END;
IF NOT CREATE(XlApp,TRUE,TRUE) THEN
ERROR(Text000);
XlApp.Workbooks.Open(FileName);
XlWrkBk := XlApp.ActiveWorkbook;
i := 1;
EndOfLoop := XlWrkBk.Worksheets.Count;
WHILE i <= EndOfLoop DO BEGIN
XlWrkshts := XlWrkBk.Worksheets.Item(i);
SheetName := XlWrkshts.Name;
IF (SheetName <> '') AND (STRLEN(SheetNames) + STRLEN(SheetName) < 250) THEN
SheetNames := SheetNames + SheetName + ','
ELSE
i := EndOfLoop;
i := i + 1;
END;
XlWrkBk.Close(FALSE);
XlApp.Quit;
CLEAR(XlApp);
EXIT(EndOfLoop);
SelectMultiSheets(SheetNumber : Integer) : Text[250]
EXIT(SELECTSTR(SheetNumber,SheetNames))