procedure GetSheetsNameListFromStream(FileStream: InStream; var TempNameValueBufferOut: Record "Name/Value Buffer" temporary) SheetsFound: Boolean var SheetNames: DotNet ArrayList; SheetName: Text[250]; i: Integer; begin XlWrkBkReader := XlWrkBkReader.Open(FileStream); TempNameValueBufferOut.Reset(); TempNameValueBufferOut.DeleteAll(); SheetNames := SheetNames.ArrayList(XlWrkBkReader.SheetNames); if IsNull(SheetNames) then exit(false); SheetsFound := SheetNames.Count > 0; if not SheetsFound then exit(false); for i := 0 to SheetNames.Count - 1 do begin SheetName := SheetNames.Item(i); if SheetName <> '' then begin TempNameValueBufferOut.Init(); TempNameValueBufferOut.ID := i; TempNameValueBufferOut.Name := Format(i + 1); TempNameValueBufferOut.Value := SheetName; TempNameValueBufferOut.Insert(); end; end; CloseBook; end;
Answers
From the "Excel Buffer" table you can use the procedure GetSheetsNameListFromStream, and if it return true check the temp table TempNameValueBufferOut for the worsheet name that you are looking for.
Regards