calling up a workbook

G

Gmick

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
 
Top