ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   SaveAs (https://www.excelbanter.com/excel-programming/384128-saveas.html)

brownti via OfficeKB.com

SaveAs
 
Here is my code. The problem is with the saveas command. It doesnt work.
When i click the button i want it to ask where to save as, with the initial
file name to be "proj". Any ideas?

Private Sub CommandButton1_Click()
Dim est As String, mgr As String, sls As String, build As String, _
proj As String, file As Variant
build = builder
mgr = manager
sls = sales
est = estimator
proj = project
file = proj & ".xls"
Range("est") = UCase(est)
Range("o_est") = UCase(est)
Range("mgr") = UCase(mgr)
Range("o_mgr") = UCase(mgr)
Range("sales") = UCase(sls)
Range("o_sales") = UCase(sls)
Range("builder") = UCase(build)
Range("o_builder") = UCase(build)
If Residential = True Then
Call reset_species
End If
Application.GetSaveAsFilename (file)
Unload Me
End Sub

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200702/1


Vergel Adriano

SaveAs
 
GetSaveAsFilename allows you to get a filename from the user, but it does not
actually save the file. Replace this line:

Application.GetSaveAsFilename (file)

with these 2 lines:

file = Application.GetSaveAsFilename (file)
if file<"False" then application.saveas file



"brownti via OfficeKB.com" wrote:

Here is my code. The problem is with the saveas command. It doesnt work.
When i click the button i want it to ask where to save as, with the initial
file name to be "proj". Any ideas?

Private Sub CommandButton1_Click()
Dim est As String, mgr As String, sls As String, build As String, _
proj As String, file As Variant
build = builder
mgr = manager
sls = sales
est = estimator
proj = project
file = proj & ".xls"
Range("est") = UCase(est)
Range("o_est") = UCase(est)
Range("mgr") = UCase(mgr)
Range("o_mgr") = UCase(mgr)
Range("sales") = UCase(sls)
Range("o_sales") = UCase(sls)
Range("builder") = UCase(build)
Range("o_builder") = UCase(build)
If Residential = True Then
Call reset_species
End If
Application.GetSaveAsFilename (file)
Unload Me
End Sub

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200702/1



brownti via OfficeKB.com

SaveAs
 
That didnt quite work. It doesnt like the last part of it, application.
saveas file


Vergel Adriano wrote:
GetSaveAsFilename allows you to get a filename from the user, but it does not
actually save the file. Replace this line:

Application.GetSaveAsFilename (file)

with these 2 lines:

file = Application.GetSaveAsFilename (file)
if file<"False" then application.saveas file

Here is my code. The problem is with the saveas command. It doesnt work.
When i click the button i want it to ask where to save as, with the initial

[quoted text clipped - 23 lines]
Unload Me
End Sub


--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200702/1


Andrew Taylor

SaveAs
 
SaveAs is a method of the Workbook class, so it should be

ActiveWorkbook.SaveAs file



On Feb 28, 4:20 pm, "brownti via OfficeKB.com" <u31540@uwe wrote:
That didnt quite work. It doesnt like the last part of it, application.
saveas file





Vergel Adriano wrote:
GetSaveAsFilename allows you to get a filename from the user, but it does not
actually save the file. Replace this line:


Application.GetSaveAsFilename (file)


with these 2 lines:


file = Application.GetSaveAsFilename (file)
if file<"False" then application.saveas file


Here is my code. The problem is with the saveas command. It doesnt work.
When i click the button i want it to ask where to save as, with the initial

[quoted text clipped - 23 lines]
Unload Me
End Sub


--
Message posted via OfficeKB.comhttp://www.officekb.com/Uwe/Forums.aspx/excel-programming/200702/1- Hide quoted text -

- Show quoted text -





All times are GMT +1. The time now is 12:54 PM.

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