Sign in to follow this  
Followers 0
Inverti

How to save specific Excel sheet to html

6 posts in this topic

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?

Share this post


Link to post
Share on other sites



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 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

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:

post-65285-0-87005300-1410553497_thumb.p

Share this post


Link to post
Share on other sites

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 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

_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 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0