ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Wildcard (https://www.excelbanter.com/excel-programming/361796-wildcard.html)

Robert[_30_]

Wildcard
 
Hello,

Through a macro statement I want to open an excel sheet from a pre
defined folder. As this folder always contains only one sheet (names
differ though) I was wondering if I can give add a wildcard to the
path.

For example something like:
Workbooks.Open Filename:= _
"H:\Risk_Management\Special_Review\Upload_files\*. xls"


Thanx a lot for your help and time.

Rgds,
Robert


Bob Phillips[_14_]

Wildcard
 
Use something like

sFilename = dir("H:\Risk_Management\Special_Review\Upload_file s\*.xls"
Workbooks.Open Filename:= sFilename

--
HTH

Bob Phillips

(remove xxx from email address if mailing direct)

"Robert" wrote in message
ps.com...
Hello,

Through a macro statement I want to open an excel sheet from a pre
defined folder. As this folder always contains only one sheet (names
differ though) I was wondering if I can give add a wildcard to the
path.

For example something like:
Workbooks.Open Filename:= _
"H:\Risk_Management\Special_Review\Upload_files\*. xls"


Thanx a lot for your help and time.

Rgds,
Robert





All times are GMT +1. The time now is 09:23 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com