View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Jake Marx[_3_] Jake Marx[_3_] is offline
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]