hg2052 Posted April 6, 2013 Posted April 6, 2013 I have an .au3 script that retrieves data from web pages and writes them in an EXcel workbook that it opens. Hao can I make it write data from each web page in another sheet of the same workbook, without first saving the workbook and then reopening it?
MuchTex Posted April 6, 2013 Posted April 6, 2013 (edited) I believe what you're asking for is _ExcelSheetAddNew(). After opening up a workbook you can simply use this function to open up a new sheet and begin writing data to it. Edit- I don't have access to test it right now, but you might have to use _ExcelSheetActivate() before you begin writing data to it, although I highly doubt this is necessary. Edited April 6, 2013 by MuchTex
water Posted April 6, 2013 Posted April 6, 2013 You have to use _ExcelSheetActivate because all other functions just write to the active WorkSheet. This will change with my ExcelEX UDF - but this is still in a very early Alpha state. My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
hg2052 Posted April 6, 2013 Author Posted April 6, 2013 MuchTex, _ExcelSheetAddNew() needs 2 arguments. I cannot retrieve the second from a workbook on the desktop,where I did already fill Sheet1.
water Posted April 6, 2013 Posted April 6, 2013 Does the workbook you talk about already have all needed worksheets or do you need to add new worksheets to the workbook? My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
hg2052 Posted April 7, 2013 Author Posted April 7, 2013 Water, It has the sheets, as always when you launch Excel.exe : Book1 -> Sheet1,Sheet2,Sheet3...etc
water Posted April 7, 2013 Posted April 7, 2013 MuchTex,_ExcelSheetAddNew() needs 2 arguments. I cannot retrieve the second from a workbook on the desktop,where I did already fill Sheet1.The second parameter is the name of the new sheet and is optional. If you don't know the name simply let Excel select a name. My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
water Posted April 7, 2013 Posted April 7, 2013 Ok, lets stick with your on this subject where you hve already posted some code we can work on.BTW: You know that the Mods don't like to see multiple threads on the same subject? My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
hg2052 Posted April 7, 2013 Author Posted April 7, 2013 Water, 2.Mods...I know. But it's about 2 subjects in the same script. 1.In my script, when I tried to "let Excel choose",I got the error message saying it needed 2 parameters.
water Posted April 7, 2013 Posted April 7, 2013 Can you please post the code you used. Parameter 2 of _ExcelSheetAddNew is definitely optional. My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now