Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 85
Default Find filename of open file

Hi Jim

Works a treat, thanks. I still wish I knew why I couldn't OPEN the template
instead of creating a NEW FILE based on it, but at least I have a
workaround.

Ian

"Ian" wrote in message
...
Thanks, Jim.

I've not tested this yet, but it looks like it'll do what I need. I should
be able to loop through the open workbooks until I find a match with the
partial filename I have, then activate the matched workbook.

Ian

"Jim Thomlinson" wrote in
message ...
Something like this will give you the names of all open workbooks...

Sub Test
dim wbk as workbook

for each wbk in workbooks
msgbox wbk.name
next wbk
end sub
--
HTH...

Jim Thomlinson


"Ian" wrote:

I've tried, and failed, to successfully open a template as an xlt file
(rather than xls) so I'm trying a different method to achieve what I
need.

My problem is this. Having opened a couple of files, I want to activate
a
specific one. Based on template filename.xlt, the workbook _should_ be
filename1.xls, but this is not necessarily going to be the case. How can
I
determine the filename of the open file? I can't use Dir as the file
hasn't
been saved at this point.

Any ideas?

Ian







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
Excel wants to save an open file to another filename in VBA script BPoppe Excel Programming 0 November 9th 07 09:24 AM
Open File based on filename in cell TOMB Excel Programming 4 April 26th 07 07:55 PM
Open file with unknown extra characters at end of filename achidsey Excel Programming 1 October 19th 05 09:21 PM
Macro to read filename in cell and open new file April Excel Programming 2 July 27th 05 02:49 PM
Why doesn't the File Open list sort into filename order? cycler New Users to Excel 7 July 16th 05 06:44 PM


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

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

About Us

"It's about Microsoft Excel"