Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
Default Application.GetSaveAsFilename

Major novice requiring assistance.

Using the following for a button (very basic) but whilst it opens as expected (save as) it doesn't actually save.

Sub Xxxxxx_SaveAs()

Application.GetSaveAsFilename


End Sub


I hear it may be a compatibility issue, but if anyone can provide an alternative to solve my problem, it would be most appreciated.

Cheers
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
Default Application.GetSaveAsFilename

On Tuesday, December 4, 2012 5:56:56 PM UTC, GS wrote:
mctavish14 presented the following explanation :

Major novice requiring assistance.




Using the following for a button (very basic) but whilst it opens as expected


(save as) it doesn't actually save.




Sub Xxxxxx_SaveAs()




Application.GetSaveAsFilename






End Sub






I hear it may be a compatibility issue, but if anyone can provide an


alternative to solve my problem, it would be most appreciated.




Cheers




It does exactly what its name implies; it returns the filename you want

to save as. You actually have to save it using Application.SaveAs and

pass the filename obtained...



Dim vFileToSave As Variant

With Application

vFileToSave = .GetSaveAsFilename

If vFileToSave = False Then Exit Sub '//user cancels

.SaveAs Filename:=vFileToSave

End With 'Application



--

Garry



Free usenet access at http://www.eternal-september.org

Classic VB Users Regroup!

comp.lang.basic.visual.misc

microsoft.public.vb.general.discussion


Garry,

Thanks for the reply. Both codes now open the Save As window and populate the File name: field with that of the workbook, but it still does not save to any location you select. You click Save and expect it to have worked, as there's no error or sign that it has not worked, but the file is not there.

The Save as type: field is All Files (*.*) is this an issue?

I'm guessing I need something a lot more complex than my current skills can cater for.
  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,514
Default Application.GetSaveAsFilename

The GetSaveAsFilename function includes the path and so is passed to
the Workbook.SaveAs function.

Oops! I see I did not include a ref to the workbook. Sorry about
that...

Dim vFileToSave As Variant

vFileToSave = Application.GetSaveAsFilename
If vFileToSave < False Then _
ActiveWorkbook.SaveAs Filename:=vFileToSave

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion


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
Application.GetSaveAsFilename question Bishop Excel Programming 6 May 1st 09 04:56 PM
Application.GetSaveAsFilename problem Bishop Excel Programming 3 April 30th 09 08:56 PM
a question about "Application.GetSaveAsFileName" 12Keys Excel Programming 2 April 13th 06 06:25 AM
Help with GetSaveAsFilename aj Excel Programming 0 March 23rd 06 08:32 PM
File save location with Application.GetSaveAsFilename Brad Patterson Excel Programming 1 July 21st 03 04:01 AM


All times are GMT +1. The time now is 03:14 PM.

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

About Us

"It's about Microsoft Excel"