LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Saveas Not Working

Hello,

I'm having a problem with SAVEAS in following code. Basically trying to Add
a new Workbook (wb2) so that I can move sheets to it from an existing
workbook (wb1). When running, I get the dialogue box asking me to save as in
the correct directory, and it seems to save, but at the end of the routine
the file doesn't exist in the directory. When I step through the code, I can
see at the point right after I get the SaveAs Dialogue box (wb2.SaveAs
ChosenFileName, xlWorkbookNormal) that the workbook still has it's original
default name assigned by the Workbooks.Add command (Book1.xls, or whatever it
is). Not sure how to troubleshoot this . . . I don't get any error.

Any help is very appreciated. Thanks in advance.

Dim CurrentPath As String
Dim Filename As Variant

'Store the current path
CurrentPath = CurDir

'Change the path to the one we want
SetCurrentDirectory "\\SRV1\RATER\Attach PIC Rater"


'setting activeworkbook (self-rater) as wb1
Set wb1 = ActiveWorkbook
wb1Name = ActiveWorkbook.Name


'Adding a new workbook to move Quote tab to
Dim wb2 As Workbook
Set wb2 = Workbooks.Add
tamfile = InputBox("Enter your Prospect Code", "Save As Prospect Code",
wb1Name)

ChosenFileName = Application.GetSaveAsFilename(tamfile, "Excel Files
(*.xls),*.xls,", , "Title")
wb2.SaveAs ChosenFileName, xlWorkbookNormal


 
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 ActiveWorkbook.SaveAs Filename:=Range("A1").Value DarrenL Excel Programming 4 April 18th 09 07:54 AM
Calculate working days but change working week SamB Excel Discussion (Misc queries) 1 September 1st 08 09:17 PM
BeforeSave event fired but not working when triggered by SaveAs. Anders Excel Programming 3 October 6th 06 04:58 PM
SaveAs another file name, then keep working L Mehl Excel Programming 2 February 24th 04 02:11 AM
Help with SaveAs Glen Mettler[_2_] Excel Programming 1 February 14th 04 02:48 AM


All times are GMT +1. The time now is 08:55 AM.

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"