Hi All
I need help
How read from Excel rows row by row with images with XLSReadWriteII?
I have excel file with goods list with image how read and import to database?
Can you give sample?
How read from Excel rows row by row with images with XLSRead
Re: How read from Excel rows row by row with images with XLSRead
Hello
Loop trough the Images object of the Drawing object and check the Row1 and Row2 properties of the images. Please study the Pictures sample for more details.
Loop trough the Images object of the Drawing object and check the Row1 and Row2 properties of the images. Please study the Pictures sample for more details.
Lars Arvidsson, Axolot Data
Re: How read from Excel rows row by row with images with XLSRead
Can you make little bit source or example i found other example but comobj
But i want how do this by your lib?
Code: Select all
procedure TForm1.Button1Click(Sender: TObject);
var
ExcelObj:OleVariant;
SheetObj:OleVariant;
CellObj:OleVariant;
i:integer;
pict_count:integer;
pict: TPicture;
begin
ExcelObj := CreateOleObject('excel.application');
ExcelObj.Application.DisplayAlerts:=False;
ExcelObj.Workbooks.Open(ExtractFilePath(application.ExeName)+ 'Book1.xlsx');
SheetObj:=ExcelObj.Workbooks[1].Sheets[1];
pict_count:=sheetObj.Pictures.Count;
for i := 0 to pict_count-1 do begin
CellObj:=SheetObj.Pictures[i+1].TopLeftCell;
//for log
Memo1.Lines.Add(format('[ %d , %d ]',[integer(CellObj.Row),integer(CellObj.Column)])) ;
SheetObj.Pictures[i+1].select;
SheetObj.Pictures[i+1].copy;
if Clipboard.HasFormat(CF_PICTURE) then begin
pict := TPicture.Create;
try
pict.Assign(Clipboard);
pict.SaveToFile(format('%s',[SheetObj.Pictures[i+1].Name]));
pict.Free;
except
// Can't convert
end;
end;
end;
SheetObj:=unassigned;
CellObj:=unassigned;
ExcelObj.Quit;
ExcelObj:=unassigned;
end;
But i want how do this by your lib?