#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 103
Default 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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 857
Default 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


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 103
Default 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

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 225
Default 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 -



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
SaveAs - VBA Jae[_3_] Excel Discussion (Misc queries) 4 April 10th 08 08:10 PM
SaveAs - VBA Jae Excel Discussion (Misc queries) 0 April 10th 08 06:04 AM
VBA SaveAs Value charlie Excel Discussion (Misc queries) 4 August 27th 07 11:33 PM
Saveas Dale Levesque Excel Programming 6 May 5th 04 04:06 PM
SaveAs Darrin Henry Excel Programming 0 September 12th 03 10:09 PM


All times are GMT +1. The time now is 10:17 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"