Local object &oWorkApp, &oWorkBook;
&sFilePath = "C:\temp\TEST_FL.xlsx";
&sFileDestPath = "C:\temp\Test.xlsx";
&oWorkApp = CreateObject("COM",
"Excel.Application");
&oWorkApp.DisplayAlerts = "False";
ObjectSetProperty(&oWorkApp, "Visible", True);
&oWorkBook = ObjectGetProperty(&oWorkApp,
"Workbooks");
&oWorkBook.Open(&sFilePath);
&oWorkSheet = &oWorkApp.Worksheets("Sheet1");
&oWorkSheet.Range("A1:C5").Font.Bold = True;
&oWorkApp.WorkSheets.Add().Name = "Test";
&oWorkSheet = &oWorkApp.Worksheets("Test");
&oWorkSheet.Range("A1:C5").Font.Bold = True;
&oWorkSheet.Cells(1, 1).Value = "I'm adding stuff to be
bolded";
&oWorkSheet.Cells(1, 1).Font.Bold = True;
&oWorkSheet.Cells(1, 1).Font.Size = 24;
&oWorkSheet.Cells(1, 1).Font.ColorIndex = 3;
&oWorkApp.ActiveWorkbook.SaveAs(&sFileDestPath);
&oWorkApp.ActiveWorkBook.Close();
&oWorkApp.DisplayAlerts = "True";
&oWorkApp.Quit();
No comments:
Post a Comment