andrew_pitt
12 years agoNew Contributor
Best way to control Excel?
Hi All,
I am after suggestions for the best way to control Excel using TestComplete.
I have a .NET application that launches Excel with a macro loaded. I then need to modify the data in excel, save, then confirm that the data modified in Excel is reflected in the .NET application
The scenario is as follows:
1. (while .NET application is open) Click "open excel" button (in the application) -> Excel loads
2. open customomers .xls file -> File is open
3. Click on View -> Macros -> Select desired Macro and press Run
4. Confirm macro changes have happened
5. Close excel and confirm changes are reflected in the new application.
The part of my code is as follows:
Aliases.CATSV3.ExcelBooksGridForm1.openExcelButton.ClickButton();
Aliases.Excel_popup.Excel_popup.panel.toolbarRibbon.panelRibbon.panel.propertypageRibbon.buttonFileTab.ClickButton();
Aliases.Excel_popup.Excel_popup.panel2.pane.paneBackstageView.client.menubarFile.menuitemOpen.Click();
Aliases.EXCEL.dialogOpen.panelFileName.comboboxFileName.editFileName.SetText("C:\\automation\\files\\temp\\STAFFING MODEL XLS.xls");
Aliases.EXCEL.dialogOpen.splitbuttonOpen.Click();
Aliases.EXCEL.dialogMicrosoftExcel.buttonYes.Click();
Aliases.Excel_popup.Excel_popup.panel1.panelStaffingModelXlsCopyXls.clientSheetNavigationBar.tablistSheetTabs.ClickTab("Project Input Output Sheet");
so I am stuck trying to find out the best way to proceed.
- Using TestComplete to control Excel, I can navigate through all the Excel tabs, ribbons, file processes, etc but I cannot work out how to enter/modify data in the cells and count the columns/rows.
- Using the Sys.OleObject method, I can open up an existing Excel file or create a new one, but I cannot work out how to get TestComplete to "hook" into the already launched Excel document.
Any suggestions?
Thanks,
Andrew
I am after suggestions for the best way to control Excel using TestComplete.
I have a .NET application that launches Excel with a macro loaded. I then need to modify the data in excel, save, then confirm that the data modified in Excel is reflected in the .NET application
The scenario is as follows:
1. (while .NET application is open) Click "open excel" button (in the application) -> Excel loads
2. open customomers .xls file -> File is open
3. Click on View -> Macros -> Select desired Macro and press Run
4. Confirm macro changes have happened
5. Close excel and confirm changes are reflected in the new application.
The part of my code is as follows:
Aliases.CATSV3.ExcelBooksGridForm1.openExcelButton.ClickButton();
Aliases.Excel_popup.Excel_popup.panel.toolbarRibbon.panelRibbon.panel.propertypageRibbon.buttonFileTab.ClickButton();
Aliases.Excel_popup.Excel_popup.panel2.pane.paneBackstageView.client.menubarFile.menuitemOpen.Click();
Aliases.EXCEL.dialogOpen.panelFileName.comboboxFileName.editFileName.SetText("C:\\automation\\files\\temp\\STAFFING MODEL XLS.xls");
Aliases.EXCEL.dialogOpen.splitbuttonOpen.Click();
Aliases.EXCEL.dialogMicrosoftExcel.buttonYes.Click();
Aliases.Excel_popup.Excel_popup.panel1.panelStaffingModelXlsCopyXls.clientSheetNavigationBar.tablistSheetTabs.ClickTab("Project Input Output Sheet");
so I am stuck trying to find out the best way to proceed.
- Using TestComplete to control Excel, I can navigate through all the Excel tabs, ribbons, file processes, etc but I cannot work out how to enter/modify data in the cells and count the columns/rows.
- Using the Sys.OleObject method, I can open up an existing Excel file or create a new one, but I cannot work out how to get TestComplete to "hook" into the already launched Excel document.
Any suggestions?
Thanks,
Andrew