PC Review


Reply
Thread Tools Rate Thread

calling up a workbook

 
 
Gmick
Guest
Posts: n/a
 
      10th Sep 2004
In my macro I do a 'save as', in which the program calls for the 'save
as' by a variable (called 'stage_name'). I save the sheet - don't close
it - go on with another sheet and do another save as (by a variable
'stage_order'). Now I want to activate the workbook stage_name. It
doesn't work what am I doing wrong?

Here is what my macro looks like :

'prompt for a save as....
Do
OrderFormName =
Application.GetSaveAsFilename(InitialFileName:="Sales Order_Rep Name", _
fileFilter:="Microsoft Excel (*.xls), *.xls")
Loop Until OrderFormName <> False
ActiveWorkbook.SaveAs Filename:=OrderFormName

'activate the worksheet tab and copy stage worksheet to a new book
Worksheets("Stage").Activate
Sheets("Stage").Select
Sheets("Stage").Copy
Cells.Select

'prompt for a save as..
Do
StageName =
Application.GetSaveAsFilename(InitialFileName:="Stage_order", _
fileFilter:="Microsoft Excel (*.xls), *.xls")
Loop Until StageName <> False
ActiveWorkbook.SaveAs Filename:=StageName

'save and close "Stage"-workbook
Workbooks(StageName).Activate
ActiveWorkbook.Save
ActiveWorkbook.Close

'close the active workbook
Workbooks(OrderFormName).Activate
ActiveWorkbook.Save
ActiveWorkbook.Close
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Calling subroutine defined in another workbook (autostart workbook) Scott Bass Microsoft Excel Programming 5 17th Nov 2010 12:05 PM
Calling open workbook from another workbook Merlynsdad Microsoft Excel Programming 8 20th Oct 2009 04:07 PM
Passing calling workbook name to called workbook =?Utf-8?B?RFJL?= Microsoft Excel Programming 7 6th May 2006 01:34 AM
Calling a Personal.XLS Sub from anther workbook's 'This Workbook' Sheet Activate Jack Gillis Microsoft Excel Discussion 2 21st Mar 2005 11:58 PM
Reference code in another workbook from a calling workbook =?Utf-8?B?RGF0YXNvcnQ=?= Microsoft Excel Programming 1 4th Jan 2005 01:13 AM


Features
 

Advertising
 

Newsgroups
 


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