![]() |
SaveCopyAs
I am working with the code "SaveCopyAs" and have run in to
a wall. What I want is when I click on a button in my document; I want excel to ask if the user wants to save the document and if so, save it as a user defined name and location. I know I could set the original as read-only but I do not want to do that. Private Sub Save_As_Click() Workbooks("Master Template v2.1.XLS").SaveCopyAs End Sub This is the code I have so far but do not know what to place after "SaveCopyAs" |
SaveCopyAs
Greg,
You have to include the full save-as file name after SaveCopyAs. E.g, Workbooks("Master Template v2.1.XLS").SaveCopyAs _ "C:\Temp\MasterBackup.xls" -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Greg Hadrych" wrote in message ... I am working with the code "SaveCopyAs" and have run in to a wall. What I want is when I click on a button in my document; I want excel to ask if the user wants to save the document and if so, save it as a user defined name and location. I know I could set the original as read-only but I do not want to do that. Private Sub Save_As_Click() Workbooks("Master Template v2.1.XLS").SaveCopyAs End Sub This is the code I have so far but do not know what to place after "SaveCopyAs" |
SaveCopyAs
Take at look at.....
Application.GetSaveAsFilename Cheers Nigel "Greg Hadrych" wrote in message ... I am working with the code "SaveCopyAs" and have run in to a wall. What I want is when I click on a button in my document; I want excel to ask if the user wants to save the document and if so, save it as a user defined name and location. I know I could set the original as read-only but I do not want to do that. Private Sub Save_As_Click() Workbooks("Master Template v2.1.XLS").SaveCopyAs End Sub This is the code I have so far but do not know what to place after "SaveCopyAs" |
SaveCopyAs
Thanks for the help ... seeing as how i know very little
about coding, where would i but that string of code? Right afer what i have or somewhere else? -----Original Message----- str_Destination_FileName = Application.getSaveAsFileName (fileFilter:="Excel Files (*.xls), *.xls") newWorkbook.SaveAs Filename:=str_Destination_FileName I hope this would help you. "Greg Hadrych" wrote: I am working with the code "SaveCopyAs" and have run in to a wall. What I want is when I click on a button in my document; I want excel to ask if the user wants to save the document and if so, save it as a user defined name and location. I know I could set the original as read-only but I do not want to do that. Private Sub Save_As_Click() Workbooks("Master Template v2.1.XLS").SaveCopyAs End Sub This is the code I have so far but do not know what to place after "SaveCopyAs" . |
SaveCopyAs
Here's one example:
Sub SaveCopyAsToSameDirectory() Dim lStr_TargetFile As String With ThisWorkbook .SaveCopyAs ThisWorkbook.Path & "\" & _ Left(ThisWorkbook.Name, InStr(1, LCase(ThisWorkbook.Name), ".xls") - 1) & _ " - " & Format(Now, "yyyymmdd hhmmss") & ".xls" .Save End With End Sub There are more at: http://www.bygsoftware.com/Excel/VBA/saving.htm -- Regards Andy Wiggins www.BygSoftware.com Home of "Save and BackUp", "The Excel Auditor" and "Byg Tools for VBA" "Greg Hadrych" wrote in message ... I am working with the code "SaveCopyAs" and have run in to a wall. What I want is when I click on a button in my document; I want excel to ask if the user wants to save the document and if so, save it as a user defined name and location. I know I could set the original as read-only but I do not want to do that. Private Sub Save_As_Click() Workbooks("Master Template v2.1.XLS").SaveCopyAs End Sub This is the code I have so far but do not know what to place after "SaveCopyAs" |
All times are GMT +1. The time now is 12:48 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com