ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Save as box (https://www.excelbanter.com/excel-programming/341923-save-box.html)

EMoe[_61_]

Save as box
 

Hello!

I was wondering how to call up the "save as" box with code (as if you
went to File and selected Save As...). I tried through the macro
recorder, but it wouldn't let me stop recording when the box was open.

Thanks,
ME


--
EMoe
------------------------------------------------------------------------
EMoe's Profile: http://www.excelforum.com/member.php...o&userid=23183
View this thread: http://www.excelforum.com/showthread...hreadid=473255


Rowan Drummond[_3_]

Save as box
 
You could adapt this:

Sub SaveAs()
Dim flname As String
Dim fullName As Variant
Dim filter As String
flname = "SaveName"
filter = "Excel Files (*.xls), *.xls"
fullName = Application.GetSaveAsFilename(flname, filter, , _
"Save File as...")
If fullName < False Then
Application.DisplayAlerts = False
ThisWorkbook.SaveAs fullName
Application.DisplayAlerts = True
End If
End Sub


Hope this helps
Rowan

EMoe wrote:
Hello!

I was wondering how to call up the "save as" box with code (as if you
went to File and selected Save As...). I tried through the macro
recorder, but it wouldn't let me stop recording when the box was open.

Thanks,
ME



EMoe[_63_]

Save as box
 

Thanks Rowan,

This code works perfectly. This is what I was looking for.

Regards,
EMoe :)


--
EMoe
------------------------------------------------------------------------
EMoe's Profile: http://www.excelforum.com/member.php...o&userid=23183
View this thread: http://www.excelforum.com/showthread...hreadid=473255


Rowan Drummond[_3_]

Save as box
 
You're welcome.

EMoe wrote:
Thanks Rowan,

This code works perfectly. This is what I was looking for.

Regards,
EMoe :)




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

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