Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 860
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
When I open Excel, workbooks open automatically. How can I stop t Rhealbird Excel Discussion (Misc queries) 2 February 23rd 06 10:08 AM
open workbook using wildcard Ben Excel Programming 7 June 6th 05 05:02 AM
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 Frank Jones Excel Programming 2 June 15th 04 03:21 AM
Workbooks.Open / .Open Text - How do you stop the .xls addition? Dave[_20_] Excel Programming 2 July 31st 03 04:03 AM
Using wildcard for checking whether files are open [email protected] Excel Programming 1 July 30th 03 06:47 PM


All times are GMT +1. The time now is 08:32 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"