Thread: Save As command
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Save As command

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.

--
Regards,
Tom Ogilvy


"Nikita" wrote in message
...
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