i am using delphi7
i want to open and read a protected xls document, i can't do it,
how can i check the excel document status: workbooks protected and worksheet protected?
I can't find any demo code.
and how to use the OnPassword event in delphi 7?
thanks very much.
How can i open and read a protected *.xls
Re: How can i open and read a protected *.xls
Hello
If the file is protected, you don't have to do anything. Protection is just a flag that excel uses to prevent users from editing files. This is not implemented in XLSReadWriteII. Is the file encrypted, and hence requiring a password, there will be an exception telling that. You can provide the password in the OnPassword event.
If the file is protected, you don't have to do anything. Protection is just a flag that excel uses to prevent users from editing files. This is not implemented in XLSReadWriteII. Is the file encrypted, and hence requiring a password, there will be an exception telling that. You can provide the password in the OnPassword event.
Lars Arvidsson, Axolot Data
-
- Posts: 2
- Joined: Mon Sep 09, 2013 1:38 pm
Re: How can i open and read a protected *.xls
Hi
i'm using xlsreadwrite 4
when i open a *.xls document with open password, it is work well. and i can get the sheets count. however, if i want to open a 2007 *.xlsx document, i get a exception"Project project1.exe raised exception chlass EaccessViolation with message "Access violation at address oo17f6af Write of address 01c7f280"" Process stoped Use step or run to continue.
/////////////////////////////////////////////// open *.xls
var xlsto:TXLSReadWriteII4;
begin
xlsto:=TXLSReadWriteII4.Create(xlsto);
xlsto.Filename:='c:\t.xls';
xlsto.Password:='aaa';
xlsto.Read;
ShowMessage(IntToStr(xlsto.Sheets.Count));
xlsto.Free;
end;
///////////////////////////////////////////////// the same code can't work when i open a *.xlsx document
var xlsto:TXLSReadWriteII4;
begin
xlsto:=TXLSReadWriteII4.Create(xlsto);
xlsto.Filename:='c:\t.xlsx';
xlsto.Password:='aaa';
xlsto.Read;
ShowMessage(IntToStr(xlsto.Sheets.Count));
xlsto.Free;
end;
i'm using xlsreadwrite 4
when i open a *.xls document with open password, it is work well. and i can get the sheets count. however, if i want to open a 2007 *.xlsx document, i get a exception"Project project1.exe raised exception chlass EaccessViolation with message "Access violation at address oo17f6af Write of address 01c7f280"" Process stoped Use step or run to continue.
/////////////////////////////////////////////// open *.xls
var xlsto:TXLSReadWriteII4;
begin
xlsto:=TXLSReadWriteII4.Create(xlsto);
xlsto.Filename:='c:\t.xls';
xlsto.Password:='aaa';
xlsto.Read;
ShowMessage(IntToStr(xlsto.Sheets.Count));
xlsto.Free;
end;
///////////////////////////////////////////////// the same code can't work when i open a *.xlsx document
var xlsto:TXLSReadWriteII4;
begin
xlsto:=TXLSReadWriteII4.Create(xlsto);
xlsto.Filename:='c:\t.xlsx';
xlsto.Password:='aaa';
xlsto.Read;
ShowMessage(IntToStr(xlsto.Sheets.Count));
xlsto.Free;
end;
Re: How can i open and read a protected *.xls
var xlsto:TXLSReadWriteII4;
begin
xlsto:=TXLSReadWriteII4.Create(xlsto);
xlsto.Filename:='c:\t.xlsx';
xlsto.Password:='aaa';
xlsto.Read;
ShowMessage(IntToStr(xlsto.Sheets.Count));
xlsto.Free;
end;
Having same problem in XE3 is there a fix or workaround?
Thanks
Re: How can i open and read a protected *.xls
Hello
Encrypted XLSX files are not supported.
Encrypted XLSX files are not supported.
Lars Arvidsson, Axolot Data