Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Using Wildcard on Workbooks.Open
I want to use a wildcard on the Workbooks.Open command, but it doesn't
recognize the wilcard character as being a wildcard but part of the filename. I'm concatenating two string variables into the filename. Any idea if this will work? Code: Workbooks.Open Filename:="\\Yucca\" & Name1 & "_" & Name2 & "*.xls" |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Using Wildcard on Workbooks.Open
Hi Stever,
Stever wrote: I want to use a wildcard on the Workbooks.Open command, but it doesn't recognize the wilcard character as being a wildcard but part of the filename. I'm concatenating two string variables into the filename. Any idea if this will work? Code: Workbooks.Open Filename:="\\Yucca\" & Name1 & "_" & Name2 & "*.xls" You can't use wildcards with the Open method - you'll have to determine the exact filename. You could use the Dir$() function to ascertain the actual filename given the wildcard-based one, then pass the actual filename to the Open method. -- Regards, Jake Marx www.longhead.com [please keep replies in the newsgroup - email address unmonitored] |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
When I open Excel, workbooks open automatically. How can I stop t | Excel Discussion (Misc queries) | |||
open workbook using wildcard | Excel Programming | |||
Excel 2003 Workbooks.Open with CorruptLoad=xlRepairFile fails on Excel 5.0/95 file due to Chart, with Error 1004 Method 'Open' of object 'Workbooks' failed | Excel Programming | |||
Workbooks.Open / .Open Text - How do you stop the .xls addition? | Excel Programming | |||
Using wildcard for checking whether files are open | Excel Programming |