Hi
I would like to open an excel-file and look at at certain sheet, and on the other hand I would like to know what sheet is active.
But I can't make it function.
I use XLSSpreadSheet in Delphi 7
King regards
Kenneth
certain sheet
Problem solved. Another problem:
I have found the solution. By looking at the advertising of XLSSpreadSheet on this site I found that I have to use XLSReadWriteII4:
[quote]
as all control of the Excel data is trough the XLSReadWriteII object of XLSSpreadSheet.
[unquote]
But then I got another problem:
After having written to an excelfile, the sheets are protected, at if I try to open the file I get an access error.
When I use Excel to remove the protection I can open the file again.
But how do I avoid that the WorkBook or the sheets get protected? - Or how do I remove the protection programmatically?
Kind regards
Kenneth
[quote]
as all control of the Excel data is trough the XLSReadWriteII object of XLSSpreadSheet.
[unquote]
But then I got another problem:
After having written to an excelfile, the sheets are protected, at if I try to open the file I get an access error.
When I use Excel to remove the protection I can open the file again.
But how do I avoid that the WorkBook or the sheets get protected? - Or how do I remove the protection programmatically?
Kind regards
Kenneth
new download
In order to try to adress my problems, I downloaded new versions of XLSReadWriteII4 and XLSSpreadSheet (the dcu' s are dated 03.10.08 12:06).
When I only use XLS.Read and XLS.Write it works.
But when I try to use the XLSSpreadSheet I get an error:
[Fatal Error] Unit1.pas: Unit XBookPaintGDI was compiled with a different version of CellFormats4.TCellFormats
So what now???
Kind regards
Kenneth
When I only use XLS.Read and XLS.Write it works.
But when I try to use the XLSSpreadSheet I get an error:
[Fatal Error] Unit1.pas: Unit XBookPaintGDI was compiled with a different version of CellFormats4.TCellFormats
So what now???
Kind regards
Kenneth
Thank you for your reply. I have had the same idea, and I have removed any trace of earlier version of XLS components.
I have downloaded XLSReadWriteII 4 and XLSSpreadSheet simultaneusly and have re-installed them
To test the installation I made a form with the XLSSpreadSheet and opened a file. This is all I do:
procedure TForm1.FormActivate(Sender: TObject);
begin
XLSSpreadSheet1.XLS.Filename:='c:\tmp\Excelimport.xlsx';
XLSSpreadSheet1.XLS.Read;
XLSSpreadSheet1.XLS.Sheets[0].AsInteger[1,2]:=7;
XLSSpreadSheet1.XLS.Write;
end;
But I get an Access violation at address 004DECCB, and this points at:
if (Col = FActiveCol) and (Row = FActiveRow) then
AreaHit := sahActiveCell;
in the file SheetData4
Do you have an idea?
Kindly Kenneth
I have downloaded XLSReadWriteII 4 and XLSSpreadSheet simultaneusly and have re-installed them
To test the installation I made a form with the XLSSpreadSheet and opened a file. This is all I do:
procedure TForm1.FormActivate(Sender: TObject);
begin
XLSSpreadSheet1.XLS.Filename:='c:\tmp\Excelimport.xlsx';
XLSSpreadSheet1.XLS.Read;
XLSSpreadSheet1.XLS.Sheets[0].AsInteger[1,2]:=7;
XLSSpreadSheet1.XLS.Write;
end;
But I get an Access violation at address 004DECCB, and this points at:
if (Col = FActiveCol) and (Row = FActiveRow) then
AreaHit := sahActiveCell;
in the file SheetData4
Do you have an idea?
Kindly Kenneth
solved
Please don't waste anymore time on this.
If I write
XLSSpreadSheet1.Filename:=....
XLSSpreadSheet1.Read
in stead of
XLSSpreadSheet1.XLS.Filename:=....
XLSSpreadSheet1.XLS.Read
it works.
So all I need is a small manual to XLSSpreadSheet to help me get the syntax right. That way we can all get some more sleep.
Kind regards
Kenneth
If I write
XLSSpreadSheet1.Filename:=....
XLSSpreadSheet1.Read
in stead of
XLSSpreadSheet1.XLS.Filename:=....
XLSSpreadSheet1.XLS.Read
it works.
So all I need is a small manual to XLSSpreadSheet to help me get the syntax right. That way we can all get some more sleep.
Kind regards
Kenneth