Inverti Posted September 11, 2014 Posted September 11, 2014 Currently I use: _Excel_BookSaveAs($oWorkbook, $sWorkbook, $xlHtml, True) to save the Excel workbook to html and it works great. Now, I want to save to html only specific sheet in workbook, or specific Pivot table on this sheet. It is achievable by "Save As" dialog, there I can choose the range, but I don't know how to automate it by AutoIT or VBA. Could you please give me a clue how to do it?
water Posted September 11, 2014 Posted September 11, 2014 Which version of Excel do you run? I tried the SaveAs dialog with Excel 2010 but couldn't find a way to specify the range to be saved. 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
Inverti Posted September 12, 2014 Author Posted September 12, 2014 I use Excel 2013, but as far as I remember the option was available in 2010, maybe even in 2007. When I choose "Save As" and choose the .html file format ("Strona sieci Web" in Polish) additional options are shown at the bottom of the dialog:
Solution water Posted September 13, 2014 Solution Posted September 13, 2014 I started the macro recorder in Excel and did a SaveAs to HTML. This is what I got: ActiveWorkbook.PublishObjects.Add The PublishObjects method is what you are looking for. 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
Inverti Posted September 18, 2014 Author Posted September 18, 2014 (edited) Thank you for the answer. As I understand you're the author of <Excel.au3> Please, consider adding XlSourceType and XlHtmlType Enumeration to <ExcelConstants.au3> http://msdn.microsoft.com/en-us/library/ff839450(v=office.15).aspx http://msdn.microsoft.com/en-us/library/ff194923(v=office.15).aspx Edited September 18, 2014 by Inverti
water Posted September 19, 2014 Posted September 19, 2014 _ExcelConstants.au3 contains just those constants used by any of the Excel functions in the UDF. To not bload the constants file I suggest you add those constants to your script where needed. 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