Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
how can i open a second workbook using a vba code
|
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
how can i open a second workbook using a vba code
dim wkbk2 as workbook
set wkbk2 = workbooks.open(filename:="c:\somefilename.xls") uk wrote: -- Dave Peterson |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
how can i open a second workbook using a vba code
hi i have tried the code that you recommended but i cannot get it to work
"Dave Peterson" wrote: dim wkbk2 as workbook set wkbk2 = workbooks.open(filename:="c:\somefilename.xls") uk wrote: -- Dave Peterson . |
#4
Posted to microsoft.public.excel.misc
|
|||
|
|||
how can i open a second workbook using a vba code
Not if you did not add more to it.
Show us the code you tried that does not work. Gord Dibben MS Excel MVP On Thu, 26 Nov 2009 09:20:01 -0800, uk wrote: hi i have tried the code that you recommended but i cannot get it to work "Dave Peterson" wrote: dim wkbk2 as workbook set wkbk2 = workbooks.open(filename:="c:\somefilename.xls") uk wrote: -- Dave Peterson . |
#5
Posted to microsoft.public.excel.misc
|
|||
|
|||
how can i open a second workbook using a vba code
this is a code from MACROS MADE EASY
Sub Workbook_Open() Workbooks.Open("data.xls") End Sub "Gord Dibben" wrote: Not if you did not add more to it. Show us the code you tried that does not work. Gord Dibben MS Excel MVP On Thu, 26 Nov 2009 09:20:01 -0800, uk wrote: hi i have tried the code that you recommended but i cannot get it to work "Dave Peterson" wrote: dim wkbk2 as workbook set wkbk2 = workbooks.open(filename:="c:\somefilename.xls") uk wrote: -- Dave Peterson . . |
#7
Posted to microsoft.public.excel.misc
|
|||
|
|||
how can i open a second workbook using a vba code
i have tried all the codes that you have suggested and i still cant get it to
work "Dave Peterson" wrote: Include the drive and path, too: Workbooks.Open("c:\my folder\my other folder\data.xls") (change as appropriate) uk wrote: this is a code from MACROS MADE EASY Sub Workbook_Open() Workbooks.Open("data.xls") End Sub "Gord Dibben" wrote: Not if you did not add more to it. Show us the code you tried that does not work. Gord Dibben MS Excel MVP On Thu, 26 Nov 2009 09:20:01 -0800, uk wrote: hi i have tried the code that you recommended but i cannot get it to work "Dave Peterson" wrote: dim wkbk2 as workbook set wkbk2 = workbooks.open(filename:="c:\somefilename.xls") uk wrote: -- Dave Peterson . . -- Dave Peterson . |
#8
Posted to microsoft.public.excel.misc
|
|||
|
|||
how can i open a second workbook using a vba code
What happens when you try it?
Do you have macros enabled? Are you sure that the data.xls file exists in the drive/folder you specified? How are you opening the workbook that opens the data.xls workbook? uk wrote: i have tried all the codes that you have suggested and i still cant get it to work "Dave Peterson" wrote: Include the drive and path, too: Workbooks.Open("c:\my folder\my other folder\data.xls") (change as appropriate) uk wrote: this is a code from MACROS MADE EASY Sub Workbook_Open() Workbooks.Open("data.xls") End Sub "Gord Dibben" wrote: Not if you did not add more to it. Show us the code you tried that does not work. Gord Dibben MS Excel MVP On Thu, 26 Nov 2009 09:20:01 -0800, uk wrote: hi i have tried the code that you recommended but i cannot get it to work "Dave Peterson" wrote: dim wkbk2 as workbook set wkbk2 = workbooks.open(filename:="c:\somefilename.xls") uk wrote: -- Dave Peterson . . -- Dave Peterson . -- Dave Peterson |
#9
Posted to microsoft.public.excel.misc
|
|||
|
|||
how can i open a second workbook using a vba code
Have you inadvertantly disabled events?
Copy this to Immediate Window Application.EnableEvents = True and hit Enter Gord On Sat, 28 Nov 2009 00:59:01 -0800, uk wrote: i have tried all the codes that you have suggested and i still cant get it to work "Dave Peterson" wrote: Include the drive and path, too: Workbooks.Open("c:\my folder\my other folder\data.xls") (change as appropriate) uk wrote: this is a code from MACROS MADE EASY Sub Workbook_Open() Workbooks.Open("data.xls") End Sub "Gord Dibben" wrote: Not if you did not add more to it. Show us the code you tried that does not work. Gord Dibben MS Excel MVP On Thu, 26 Nov 2009 09:20:01 -0800, uk wrote: hi i have tried the code that you recommended but i cannot get it to work "Dave Peterson" wrote: dim wkbk2 as workbook set wkbk2 = workbooks.open(filename:="c:\somefilename.xls") uk wrote: -- Dave Peterson . . -- Dave Peterson . |
#10
Posted to microsoft.public.excel.misc
|
|||
|
|||
how can i open a second workbook using a vba code
run time error '1004':
yes the macro is enabled when i open the 1st file security warning yes they are both in the 'C:\ dir i open test.xls manually and i want it to open data.xls automatically "Dave Peterson" wrote: What happens when you try it? Do you have macros enabled? Are you sure that the data.xls file exists in the drive/folder you specified? How are you opening the workbook that opens the data.xls workbook? uk wrote: i have tried all the codes that you have suggested and i still cant get it to work "Dave Peterson" wrote: Include the drive and path, too: Workbooks.Open("c:\my folder\my other folder\data.xls") (change as appropriate) uk wrote: this is a code from MACROS MADE EASY Sub Workbook_Open() Workbooks.Open("data.xls") End Sub "Gord Dibben" wrote: Not if you did not add more to it. Show us the code you tried that does not work. Gord Dibben MS Excel MVP On Thu, 26 Nov 2009 09:20:01 -0800, uk wrote: hi i have tried the code that you recommended but i cannot get it to work "Dave Peterson" wrote: dim wkbk2 as workbook set wkbk2 = workbooks.open(filename:="c:\somefilename.xls") uk wrote: -- Dave Peterson . . -- Dave Peterson . -- Dave Peterson . |
#11
Posted to microsoft.public.excel.misc
|
|||
|
|||
how can i open a second workbook using a vba code
Record a macro when you open that file manually. Use that code in the
workbook_Open event. (I'm guessing that you have a typo in your drive/path/filename.) If you have trouble modifying the workbook_open, then post the complete recorded macro. uk wrote: run time error '1004': yes the macro is enabled when i open the 1st file security warning yes they are both in the 'C:\ dir i open test.xls manually and i want it to open data.xls automatically "Dave Peterson" wrote: What happens when you try it? Do you have macros enabled? Are you sure that the data.xls file exists in the drive/folder you specified? How are you opening the workbook that opens the data.xls workbook? uk wrote: i have tried all the codes that you have suggested and i still cant get it to work "Dave Peterson" wrote: Include the drive and path, too: Workbooks.Open("c:\my folder\my other folder\data.xls") (change as appropriate) uk wrote: this is a code from MACROS MADE EASY Sub Workbook_Open() Workbooks.Open("data.xls") End Sub "Gord Dibben" wrote: Not if you did not add more to it. Show us the code you tried that does not work. Gord Dibben MS Excel MVP On Thu, 26 Nov 2009 09:20:01 -0800, uk wrote: hi i have tried the code that you recommended but i cannot get it to work "Dave Peterson" wrote: dim wkbk2 as workbook set wkbk2 = workbooks.open(filename:="c:\somefilename.xls") uk wrote: -- Dave Peterson . . -- Dave Peterson . -- Dave Peterson . -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
how do i open a data workbook when i open a timesheet workbook | Excel Discussion (Misc queries) | |||
How to code VBA: Auto open workbook and run macro | Excel Discussion (Misc queries) | |||
excel 2003 saved file will not open without a blank workbook open | Excel Discussion (Misc queries) | |||
Need VB code for workbook open to open a link | Excel Discussion (Misc queries) | |||
Need VBA Code to Open a Workbook in read only | Excel Discussion (Misc queries) |