Inverti Posted September 11, 2014 Share 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? Link to comment Share on other sites More sharing options...
water Posted September 11, 2014 Share 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 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
Inverti Posted September 12, 2014 Author Share 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: Link to comment Share on other sites More sharing options...
Solution water Posted September 13, 2014 Solution Share 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 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
Inverti Posted September 18, 2014 Author Share 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 Link to comment Share on other sites More sharing options...
water Posted September 19, 2014 Share 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 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
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