Link to home
Create AccountLog in
Avatar of nike_golf
nike_golfFlag for Afghanistan

asked on

Alternative to .savecopyas for saving to .htm or .html?

I'm looking for the exact same functionality of the .savecopyas function that will allow me to save my current workbook as another file but in an .htm/.html format.

Any ideas or solutions to doing this?

NG,
ASKER CERTIFIED SOLUTION
Avatar of aeklund
aeklund

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
Avatar of nike_golf

ASKER

The problem with the .saveas function is that it saves the original workbook and doesn't create a copy of it..  I'm looking for a copy of the workbook to be saved as .htm leaving the original in tact.

Thanks,
Avatar of aeklund
aeklund

This might not be the most efficient way, but it should work:

    Dim sOrig As String
    sOrig = Me.FullName
   
    Me.SaveAs "C:\test.htm", XlFileFormat.xlHtml
    Workbooks.Open sOrig
    Workbooks("test.htm").Close SaveChanges:=False
That involves opening the master workbook each time and is a huge time waster..

I'm looking for something more efficient.

NG,

There really is no other way to use the .savecopyas () it only save as Excel.

Thanks for the help.

NG,
already knew that answer...