Variable File Name Activation

R

Richard

Hi,

When running a query from a proprietry system, the rusltant file is opened
with a name of, for example, default(1).xls

The file is opened as a temp internet file and therefore the file name could
be, for example, default(2).xls

From a file called, for example, myfile how do I activate the default file
when the default file name is variable.

Thanks in Advance
Richard
 
P

Per Jessen

Richard said:
Hi,

When running a query from a proprietry system, the rusltant file is opened
with a name of, for example, default(1).xls

The file is opened as a temp internet file and therefore the file name
could
be, for example, default(2).xls

From a file called, for example, myfile how do I activate the default file
when the default file name is variable.

Thanks in Advance
Richard

Hi Richard

You can find the filename of the file using this code after the file is
opened (and before other files are opened).

wb = Workbooks.Count
TempFile = Workbooks(wb).Name

regards,

Per
 
R

Richard

Fantastic thanks

Per Jessen said:
Hi Richard

You can find the filename of the file using this code after the file is
opened (and before other files are opened).

wb = Workbooks.Count
TempFile = Workbooks(wb).Name

regards,

Per
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top