Link to home
Start Free TrialLog in
Avatar of jnikodym
jnikodym

asked on

Saving Excel Sheet as an HTML file

I have an excel workbook with many sheets.  I'm looking for some vba code to save one of the sheets (sheet is named Schedule) as an HTML file.  The code will need to be able to save over the existing html file that is already in the folder.  Thank you
Avatar of regmigrant
regmigrant
Flag of United Kingdom of Great Britain and Northern Ireland image

I'm assuming you tried the obvious and its not doing what you expect?

 
ActiveWorkbook.SaveAs Filename:= _
        "C:\My Documents\myfile.mht", FileFormat:= _
        xlWebArchive, CreateBackup:=False

Open in new window


If the problem is the overwrite warning try adding
Application.DisplayAlerts = False

Open in new window


before the Save as and
Application.DisplayAlerts = True

Open in new window

afterwiord

Otherwise please let me know the problem
Avatar of jnikodym
jnikodym

ASKER

I think i misspoke on what i need to do.  I have the excel file named file.xls.  What i want to do is i guess export the file to a .mht file, but i still want to be working on the file.xls file after the .mht file is saved.  Does that make sense?  With the above code it is a save as and then i am working on the .mht file.
ASKER CERTIFIED SOLUTION
Avatar of Subodh Tiwari (Neeraj)
Subodh Tiwari (Neeraj)
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial