If VarIsNull(ExcelApplication) = False thenĮxcelApplication.Visible := True //set to False if you do not want to see the activity in the backgroundĮxcelApplication.DisplayAlerts := False //ensures message dialogs do not interrupt the flow of your automation process. add error/exception handling code as desired Password := 'physiologyweb' //replace with password of your fileĮxcelApplication := CreateOleObject( 'Excel.Application') be sure ComObj and Variants units are included in the "uses" clauseĮxcelFileName := 'C:\PhysiologyWeb\delphi_code_examples\excel_file.xlsx' //replace file name with the name of your fileĮxcelFileNameNew := 'C:\PhysiologyWeb\delphi_code_examples\excel_file_new.xlsx' //replace file name with the name of your file Procedure TForm1.OpenAPasswordProtectedExcelFileAndSaveAs(Sender: TObject) ĮxcelFileName, ExcelFileNameNew, Password: String ĮxcelApplication, ExcelWorkbook, ExcelWorksheet: Variant
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |