I searched the other topics on how the Forms read information in an Excel spreadsheet.
Beauty!
But, the worksheet I need to get the information, is a password protected worksheet.
That type of protection from Excel's "Save As" of Excel, which needs to post the password to view the information and another password for editing.
Does anyone have any tips?
The code I used to open and read Excel is this below, but before opening the file and read the information, Excel asks to manually enter the password, but I want to automate it!
declare
appid pls_integer;
docid pls_integer;
conv_established boolean := false;
v_nm_destino varchar2(32000);
v_ds_classe varchar2(32000);
v_ds_local varchar2(32000);
v_nm_arquivo varchar2(32000);
v_nm_diretorio varchar2(32000);
v_nr_linha number;
v_nr_coluna number;
v_ds_dado varchar2(32000);
-- para abrir o arquivo --
begin
v_nm_destino := 'C:\TESTE.XLS';
conv_established := false;
/*
v_ds_classe := win_api_environment.read_registry('HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.xls'
,null
,false);
v_ds_local := win_api_environment.read_registry('HKEY_CLASSES_ROOT\' || v_ds_classe || '\shell\open\command'
,null
,false);
*/
appid := dde.app_begin(nvl(v_ds_local,'C:\Arquivos de programas\Microsoft Office\OFFICE11\EXCEL.EXE')
,dde.app_mode_minimized);
docid := dde.initiate('EXCEL'
,'SYSTEM');
conv_established := true;
dde.execute(docid
,'[Open("' || v_nm_destino || '")]'
,10000);
docid := dde.initiate('EXCEL'
,v_nm_destino);
-- para ler o dado -- se o excel for em ingles, ao invez de L usa-se R(row)
dde.request(docid
,replace('L2C3'
,' ')
,v_ds_dado
,dde.cf_text
,100000);
--
:BLOCO1.CODIGO := trim(replace(replace(V_DS_DADO,chr(13)),chr(10)) );
-- fecha o excel e o arquivo
dde.terminate(docid);
dde.app_end(appid);
end;
Thanks from now on all and any help !!!
Taylor Moraes