View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Per Jessen Per Jessen is offline
external usenet poster
 
Posts: 1,533
Default Variable File Name Activation


"Richard" skrev i en meddelelse
...
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