Save As command

  • Thread starter Thread starter Nikita
  • Start date Start date
N

Nikita

Hello all,
I was wondering if it is possible to create a macro
which would save changes to the existing excel file and at
the same time save a copy of this file as HTML format in
the same location as the excel file. Every time it is run
it needs to overwrite the old files (.xls and .htm) with
the new changes but keep the filenames the same.

If anyone has any ideas please help me out. Thank you
in advance.

Nikita
 
sName = thisworkbook.Fullname
On Error Resume Next
kill left(sName,len(sName)-1) & "htm" ' or "html"
On Error goto 0
thisworkbook.Save
thisworkbook.SaveAs Filename := left(sName,len(sName)-1) & "htm", _
FileFormat = xlHtm
ThisWorkbook.Close SaveChange:=False

Maybe something like the above will work.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top