ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Save file as a new file (https://www.excelbanter.com/excel-programming/317498-save-file-new-file.html)

Alvin Hansen[_2_]

Save file as a new file
 
Hi!!
When i click on my command buttom
i would like to save the file i'm working in
to a new file, the file name come's from
a variable. "filename"

Can some one help me?

Best regards alvin


Dave Peterson[_5_]

Save file as a new file
 
activeworkbook.saveas filename:=myFilename, fileformat:=xlworkbooknormal

(I wouldn't use a variable with the name Filename. Filename is used for lots of
parameters within VBA.)

There's another command that you may want:

activeworkbook.savecopyas

(see VBA's help for more info.)

Alvin Hansen wrote:

Hi!!
When i click on my command buttom
i would like to save the file i'm working in
to a new file, the file name come's from
a variable. "filename"

Can some one help me?

Best regards alvin


--

Dave Peterson


All times are GMT +1. The time now is 12:18 AM.

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