Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Macro Error
I keep receiving this error and I can't figure out what i've done wrong, any
help would be appreciated. Thanks Workbooks.Open Filename:="C:\Temp\Mgmt Team Stmt legacy.xls" Windows("Mgmt Team Stmt legacy.xls").Activate Sheets("Cover Sht").Select Sheets("Cover Sht").Copy Befo=Workbooks("Book1").Sheets(1) All I'm trying to do is copy a worksheet from a workbook, to another workbook. The last line is the line that continues to error out. |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
Macro Error
I'd try including the .xls extension:
Sheets("Cover Sht").Copy Befo=Workbooks("Book1.xls").Sheets(1) Or maybe... dim wks as worksheet set wks = Workbooks.Open(Filename:="C:\Temp\Mgmt Team Stmt legacy.xls") _ .worksheets("cover sht") wks.copy _ Befo=Workbooks("Book1.xls").Sheets(1) 'maybe??? wks.parent.close savechanges:=false Vick wrote: I keep receiving this error and I can't figure out what i've done wrong, any help would be appreciated. Thanks Workbooks.Open Filename:="C:\Temp\Mgmt Team Stmt legacy.xls" Windows("Mgmt Team Stmt legacy.xls").Activate Sheets("Cover Sht").Select Sheets("Cover Sht").Copy Befo=Workbooks("Book1").Sheets(1) All I'm trying to do is copy a worksheet from a workbook, to another workbook. The last line is the line that continues to error out. -- Dave Peterson |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
Macro Error
hi
your last line of code doesn't make sense. Before is a keyword used when adding a sheet. is that what your are trying to do? add a sheet to book 1. you need to activate book 1 or add book 1 first. post back with more info on what your are doing. regards FSt1 "Vick" wrote: I keep receiving this error and I can't figure out what i've done wrong, any help would be appreciated. Thanks Workbooks.Open Filename:="C:\Temp\Mgmt Team Stmt legacy.xls" Windows("Mgmt Team Stmt legacy.xls").Activate Sheets("Cover Sht").Select Sheets("Cover Sht").Copy Befo=Workbooks("Book1").Sheets(1) All I'm trying to do is copy a worksheet from a workbook, to another workbook. The last line is the line that continues to error out. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
I tried to get around the problem of the pivot table field settingdefaulting to Count instead of Sum by running a macro of change the settingfrom Count to Sum. However, when I tried to run the Macro, I got error messageof run time error 1004, unable | Excel Worksheet Functions | |||
I tried to get around the problem of the pivot table field settingdefaulting to Count instead of Sum by running a macro of change the settingfrom Count to Sum. However, when I tried to run the Macro, I got error messageof run time error 1004, unable | Excel Discussion (Misc queries) | |||
Macro error : Application-defined or object-defined error | Excel Discussion (Misc queries) | |||
Excel 2003 Macro Error - Runtime error 1004 | Excel Discussion (Misc queries) | |||
run macro error, please help | Excel Discussion (Misc queries) |