W
William Prendergast
I've seen this question asked several different ways but not in this
way.
If so please forgive me if this is a duplicate. I know this is a
really easy question, based on some of the stuff that already seen in
this form, but I don't not work with Excel and am just a lowly Unix
Administrator that needs to
convert alot of excel files into html.
I tried recording a macro that takes several already opened
speadsheets (the names change constantly).
s0adcr4p9.1228
s0adcr4p9.1229
s0adcr5p9.1228
s0adcr5p9.1229
and saves them as a separate html file. Basically once they
are open, do a File/Save As Web Page, then a File Close, which goes
to the
next doc and the process repeats the ideal task for a macro.
The macro I created works fine however it is not using the default
savename but instead it wants to use what was used in the macro and
I receive an error that the file already exists.
How can I change the macro to read the name of the file
thats being opened and then save it as that name with a ".htm" on the
end?
I know what I want to do.. I am just not familiar enough with excel
to do it.
Here is the macro as it was generated:
Sub NMON()
'
'
ActiveWorkbook.SaveAs Filename:= _
"C:\Documents and Settings\sswjp1\My
Documents\NMON\ARCH\s0adcr4p9.1228.htm", _
FileFormat:=xlHtml,
ReadOnlyRecommended:=False, CreateBackup:=False
ActiveWorkbook.Close
End Sub
Somehow I need to replace the s0adcr4p9.1228 with the default save as
name!
Any and all help is appreciated..
Thanks
-Bill
way.
If so please forgive me if this is a duplicate. I know this is a
really easy question, based on some of the stuff that already seen in
this form, but I don't not work with Excel and am just a lowly Unix
Administrator that needs to
convert alot of excel files into html.
I tried recording a macro that takes several already opened
speadsheets (the names change constantly).
s0adcr4p9.1228
s0adcr4p9.1229
s0adcr5p9.1228
s0adcr5p9.1229
and saves them as a separate html file. Basically once they
are open, do a File/Save As Web Page, then a File Close, which goes
to the
next doc and the process repeats the ideal task for a macro.
The macro I created works fine however it is not using the default
savename but instead it wants to use what was used in the macro and
I receive an error that the file already exists.
How can I change the macro to read the name of the file
thats being opened and then save it as that name with a ".htm" on the
end?
I know what I want to do.. I am just not familiar enough with excel
to do it.
Here is the macro as it was generated:
Sub NMON()
'
'
ActiveWorkbook.SaveAs Filename:= _
"C:\Documents and Settings\sswjp1\My
Documents\NMON\ARCH\s0adcr4p9.1228.htm", _
FileFormat:=xlHtml,
ReadOnlyRecommended:=False, CreateBackup:=False
ActiveWorkbook.Close
End Sub
Somehow I need to replace the s0adcr4p9.1228 with the default save as
name!
Any and all help is appreciated..
Thanks
-Bill