Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 413
Default After GetSaveAsFileName question

I use GetSaveAsFileName as follows:

fName = Application.GetSaveAsFilename _
(sStr, "Excel Files (*.xls),*.xls)")
If fName < ThisWorkbook.Name And fName < "False" Then

I now wish to add a new single sheet workbook and name it with
the workbook name the user chose with fName.

How do I do this, please?

Regards.


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.716 / Virus Database: 472 - Release Date: 05/07/2004


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default After GetSaveAsFileName question

Hi Stuart

Try something like this

Sub Test()
Dim fname As Variant
Dim NewWb As Workbook
Set NewWb = Workbooks.Add(xlWBATWorksheet)
fname = Application.GetSaveAsFilename("", _
fileFilter:="Excel Files (*.xls), *.xls")
If fname < "False" Then
NewWb.SaveAs fname
NewWb.Close False
Set NewWb = Nothing
Else
NewWb.Close False
Set NewWb = Nothing
End If
End Sub


--
Regards Ron de Bruin
http://www.rondebruin.nl


"Stuart" wrote in message ...
I use GetSaveAsFileName as follows:

fName = Application.GetSaveAsFilename _
(sStr, "Excel Files (*.xls),*.xls)")
If fName < ThisWorkbook.Name And fName < "False" Then

I now wish to add a new single sheet workbook and name it with
the workbook name the user chose with fName.

How do I do this, please?

Regards.


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.716 / Virus Database: 472 - Release Date: 05/07/2004




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
Help with getsaveasfilename Jo Excel Discussion (Misc queries) 2 June 5th 07 12:41 AM
GetSaveAsFilename method Donna Brooks Excel Programming 6 January 27th 04 10:37 PM
GetSaveAsFilename Anand Attavane Excel Programming 2 October 22nd 03 01:21 AM
GetSaveAsFileName Not Working Dan Gesshel Excel Programming 1 September 25th 03 03:28 AM
Excel 2002 GetSaveAsFileName Kevin May Excel Programming 1 September 23rd 03 03:33 AM


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