Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Les Les is offline
external usenet poster
 
Posts: 240
Default Opening file question

Hi all,

Is it possible to open a file if you only know part of the file name ?

For example, using a wild card. file name is
"Regressliste UX_01.06.08 To 30.06.08.xls" - The dates can vary so i would
only like to use "Regressliste UX *.xls", is this possible ??

Any help would be greatly appreciated.

--
Les
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default Opening file question

Les,

try this

Sub standard()
getbook = True
Do
If getbook = True Then
Filename = Dir("c:\Book*.xls")' Change to suit
getbook = False
Else
Filename = Dir()
End If

If Filename < "" Then
Workbooks.Open Filename:=Filename
'Do something
End If
Loop While Filename < ""
End Sub

Mike

"Les" wrote:

Hi all,

Is it possible to open a file if you only know part of the file name ?

For example, using a wild card. file name is
"Regressliste UX_01.06.08 To 30.06.08.xls" - The dates can vary so i would
only like to use "Regressliste UX *.xls", is this possible ??

Any help would be greatly appreciated.

--
Les

  #3   Report Post  
Posted to microsoft.public.excel.programming
Les Les is offline
external usenet poster
 
Posts: 240
Default Opening file question

Thanks Mike H
--
Les


"Mike H" wrote:

Les,

try this

Sub standard()
getbook = True
Do
If getbook = True Then
Filename = Dir("c:\Book*.xls")' Change to suit
getbook = False
Else
Filename = Dir()
End If

If Filename < "" Then
Workbooks.Open Filename:=Filename
'Do something
End If
Loop While Filename < ""
End Sub

Mike

"Les" wrote:

Hi all,

Is it possible to open a file if you only know part of the file name ?

For example, using a wild card. file name is
"Regressliste UX_01.06.08 To 30.06.08.xls" - The dates can vary so i would
only like to use "Regressliste UX *.xls", is this possible ??

Any help would be greatly appreciated.

--
Les

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
enable macros question not being asked when opening file Aussie Ells Excel Discussion (Misc queries) 1 June 7th 07 04:05 AM
File:1 and File:2 -- Double Files when Opening One File dallin Excel Discussion (Misc queries) 1 January 25th 07 02:53 AM
Question in opening Excel file. lklam Excel Discussion (Misc queries) 2 February 13th 06 01:39 PM
opening an excel file opens a duplicate file of the same file skm Excel Discussion (Misc queries) 1 December 7th 05 05:52 PM
In addition to previous question, if opening an Excel file in NON-read-only mode, would the macros on the worksheets work as well? Greener Excel Programming 2 October 9th 03 03:40 AM


All times are GMT +1. The time now is 06:23 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"