Guest User

Untitled

a guest
Nov 16th, 2018
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. var
  2. ExcelApp: OleVariant;
  3. anExcelFileName: String;
  4. begin
  5. try
  6. ExcelApp := CreateOleObject('Excel.Application');
  7. anExcelFileName := 'D:sample.xlsx';
  8.  
  9. ExcelApp.Workbooks.Open(anExcelFileName);
  10. ExcelApp.Visible := True;
  11.  
  12. ExcelApp.Workbooks[1].Sheets[1].Range['A1'].Value := 'HELLO';
  13. except
  14. on E: Exception do
  15. showMessage('Error on something: ' + E.Message);
  16. end;
  17. end;
Add Comment
Please, Sign In to add comment