LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
D.Parker
 
Posts: n/a
Default No Success with GetSaveAs

How do I get my new workbook filename to save to a given directory? The save
as dialog box pops up with the NewName but unfortunately the file is "not"
saved to the given directory when I click Save.

I have a button on my spreadsheet when initiates the RenameFilenameUponClose
subroutine. Dave kindly gave me advice, upon which I have tried them all but
I still am not getting a new file save to my selected directory.

Is there something obvious I am doing wrong or anything for that matter?
The code is attached.

Sub RenameFilenameUponClose()

Dim SaveName As Variant
Dim fFilter As String
Dim NewName As String

NewName = "P2 LogHistory Shift"
fFilter = "Excel Files (*.xls), *.xls"
SaveName = Application.GetSaveAsFilename _
(NewName, FileFilter:=fFilter, Title:="Save As New P2 Workbook")

If SaveName = True Then
ThisWorkbook.SaveAs Filename:=SaveName, _
FileFormat:=xlWorkbookNormal
Else
Exit Sub
End If

End Sub

Kind regards,

D.Parker
 
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



All times are GMT +1. The time now is 06:19 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"