![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Board Regular
Join Date: Mar 2002
Posts: 473
|
Hi ..
I have the MasterQuoteSheet workbook open. I create a quote then save it as another workbook. When this macro is run, after the active workbook closes The MasterQuoteSheet.xls fails to open. Does anyone know why? Thanks Ted Sub CopySheetSave() ' ' CopySheetSave Macro ' Macro recorded 03/03/2002 by Ted Pratt ' 'Save the quote ActiveWorkbook.SaveAs Filename:="Q:NEWQUOTESYSTEMQUOTES" & Range("H1").Value & Range("I1").Value & Range("J1").Value 'Close the quote ActiveWorkbook.Close 'After the save open mster sheet Workbooks.Open Filename:="Q:NEWQUOTESYSTEMMasterQuoteSheet.xls" End Sub |
|
|
|
|
|
#2 |
|
Board Regular
Join Date: Apr 2002
Location: Surrey, United Kingdom
Posts: 75
|
Eddy,
The code looks absolutely fine to me. The only thing I can think of is that your path to your 'masterquote' workbook must be wrong? Nibbs |
|
|
|
|
|
#3 |
|
New Member
Join Date: Apr 2002
Posts: 41
|
Eddy
Try moving the ActiveWorkbook.close to after the WorkBook.Open statement. Also, you may need to amend it slightly to ThisWorkbook.Close (this is because the Workbook you opened may be the active workbook and ThisWorkbook will refer to the workbook in which the code is running) Any help? Regards Robb__ |
|
|
|
|
|
#4 |
|
Board Regular
Join Date: Mar 2002
Posts: 473
|
Thanks guy's tried all the suggestions still no joy. MasterQuote Sheet fails to open.
Puzzled!! |
|
|
|
|
|
#5 |
|
New Member
Join Date: Apr 2002
Posts: 41
|
eddy
Try this instead: Sub CopySheetSave() ' ' CopySheetSave Macro ' Macro recorded 03/03/2002 by Ted Pratt ' 'Save the quote With ThisWorkbook.Worksheets("Sheet1") ActiveWorkbook.SaveAs FileName:="Q:NEWQUOTESYSTEMQUOTES" & .Range("H1").Value & _ .Range("I1").Value & .Range("J1").Value End With 'After the save open mster sheet Workbooks.Open FileName:="Q:NEWQUOTESYSTEMMasterQuoteSheet.xls" 'Close the quote ThisWorkbook.Close savechanges:=False End Sub You may need to amend the Sheet1 name to whatever is appropriate. Any help? Regards Robb__ [ This Message was edited by: Robb__ on 2002-04-29 06:55 ] [ This Message was edited by: Robb__ on 2002-04-29 06:58 ] |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|