Home > database >  How to use pb export excel and password!
How to use pb export excel and password!

Time:10-14

Units need to do a report, need to use pb export excel and add password, export excel I will, but how to add password consult everybody warrior!

CodePudding user response:

Excel developer reference
Workbook.
SaveAs methodAll show
All hidden
Save the workbook in a different file changes,
Syntax

Expression. SaveAs (FileName, FileFormat, Password, WriteResPassword, ReadOnlyRecommended, CreateBackup, AccessMode, ConflictResolution, AddToMru, TextCodepage, TextVisualLayout, Local)

CodePudding user response:

This is not a PB method of dw is Excel Workbook. The SaveAs method!!!!!!!!!!

CodePudding user response:

Can test, the following code, test environment pb12.5 + office2016
String ls_file="d: \ 111. XLS"
Dw_list. Saveas (ls_file excel8! , true)

//ActiveSheet. ProtectPassword:
=641112 '


The integer li_value
Oleobject ole_excel
Ole_excel=create oleobject
Li_value=(" excel. The application "https://bbs.csdn.net/topics/ole_excel.connecttonewobject
If li_value & lt; & gt; 0 then
Gnv_base. Of_message (" connection EXCEL failed, please check ")
The return - 1
End the if

Ole_excel. Workbooks. Open (ls_file)
String ls_file2="d: \ 222. XLS"
Ole_excel. ActiveWorkbook. SaveAs (ls_file2, 56, '1234')
Ole_excel. Quit ()
Ole_excel. Disconnectobject ()
Destroy ole_excel

CodePudding user response:

refer to the second floor di74jun response:
this is not a PB method of dw is Excel Workbook. The SaveAs method!!!!!!!!!!


Use
  • Related