ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   auto save with variable name with html extension (https://www.excelbanter.com/excel-programming/299359-auto-save-variable-name-html-extension.html)

Jason[_29_]

auto save with variable name with html extension
 
Hi All,

I have this coding to save after printing :-
-------------------------------------------------
Private Sub CommandButton1_Click()
Sheet1.Cells.PrintOut (1), (1), (2)
ThisWorkbook.SaveCopyAs (Sheet2.Cells(1, 1))
Sheet2.Cells(1, 1).Delete
ComboBox16.Text = Sheet2.Cells(1, 1)
ComboBox16.Value = Sheet2.Cells(1, 1)
ThisWorkbook.Save
End Sub
--------------------------------------------------
After the printing, it will save as a file without
extension. I will only able to read the file if I rename
the file with the Excel extenson (.xls)
My question is how can I make it to automatically save as
a html file after printing. As my coding for the file name
to save is variable, so I have problem to set the
extension.

Can anyone advise me how can I save it to the extension I
want.

Thanks a million in advance...

Cheers...

Jason


All times are GMT +1. The time now is 01:57 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com