Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I'm trying to open a group of files from a list starting at D5 on the Menu
worksheet. Following is the code i have tried. sub open_files() dim fname With ActiveWorkbook fname = "c:\documents\" & .worksheets("Menu").range("D5").value & ".xls" Workbooks.Open Filename:= fname End With End Sub the macro stops at the workbooks.open step - help would be appreciated |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
This looks ok to me...what error are you getting? Do you have a
workbook with the right filename in the c:\documents directory? |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
yes - the file is there - the error message i get is file can't be found
"jasontferrell" wrote: This looks ok to me...what error are you getting? Do you have a workbook with the right filename in the c:\documents directory? |
#4
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Change you code to add a msgbox that will display while running. Then
check the filename. You could've duplicated the "xls". sub open_files() dim fname With ActiveWorkbook fname = "c:\documents\" & .worksheets("Menu").range("D5").value & ".xls" msgbox fname Workbooks.Open Filename:= fname End With End Sub |
#5
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Thanks
the file was a 2007 file - when i save it as a 2003 the macro worked. thanks for your help "jasontferrell" wrote: Change you code to add a msgbox that will display while running. Then check the filename. You could've duplicated the "xls". sub open_files() dim fname With ActiveWorkbook fname = "c:\documents\" & .worksheets("Menu").range("D5").value & ".xls" msgbox fname Workbooks.Open Filename:= fname End With End Sub |
#6
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
What code do i need to add so that i don;t show the files as they are opening?
"jasontferrell" wrote: Change you code to add a msgbox that will display while running. Then check the filename. You could've duplicated the "xls". sub open_files() dim fname With ActiveWorkbook fname = "c:\documents\" & .worksheets("Menu").range("D5").value & ".xls" msgbox fname Workbooks.Open Filename:= fname End With End Sub |
#7
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
You can add:
Application.ScreenUpdating=False at the beginning and then set it to true at the end. |
#8
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
If the workbook is opening, then the macro stops, change the shortcut key that
you use to run the macro. Do not include the shift key. If the code stops before the workbook is opened, then what's the error? Maybe you don't have a workbook with that name???? Jack wrote: I'm trying to open a group of files from a list starting at D5 on the Menu worksheet. Following is the code i have tried. sub open_files() dim fname With ActiveWorkbook fname = "c:\documents\" & .worksheets("Menu").range("D5").value & ".xls" Workbooks.Open Filename:= fname End With End Sub the macro stops at the workbooks.open step - help would be appreciated -- Dave Peterson |
#9
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Dave
thanks - i had the file as an excel 2007 once i changed it to 2003 this worked. "Dave Peterson" wrote: If the workbook is opening, then the macro stops, change the shortcut key that you use to run the macro. Do not include the shift key. If the code stops before the workbook is opened, then what's the error? Maybe you don't have a workbook with that name???? Jack wrote: I'm trying to open a group of files from a list starting at D5 on the Menu worksheet. Following is the code i have tried. sub open_files() dim fname With ActiveWorkbook fname = "c:\documents\" & .worksheets("Menu").range("D5").value & ".xls" Workbooks.Open Filename:= fname End With End Sub the macro stops at the workbooks.open step - help would be appreciated -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
2007 List of Open Files? | Excel Discussion (Misc queries) | |||
How to change default Open/Files of Type to "Microsoft Excel Files | Excel Discussion (Misc queries) | |||
How to open a list of excel files and get update, then close it? | Excel Discussion (Misc queries) | |||
Cannot open files in Most Recently Used List | Excel Discussion (Misc queries) | |||
create a list of worksheet names (from a single folder, or open files) | Excel Discussion (Misc queries) |