[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.excel.programming

Using VBA to open an excel file

nickharthan

12/19/2006 11:54:00 AM

Hi,

I am using VBA to open an excel file (week 40). Is there any way to
use VBA to open the last saved file (week 41, 42 etc)? I want to use
the most recent file to populate my data tables.

Many thanks

nick

1 Answer

Nick Hodge

12/19/2006 12:06:00 PM

0

Nick

Why not use the GetOpenFileName() method and select the file

Dim FName as String
FName=Application.GetOpenFilename()
workbooks.open Filename:=FName

--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
nick_hodgeTAKETHISOUT@zen.co.ukANDTHIS
www.nickhodge.co.uk


<nickharthan@gmail.com> wrote in message
news:1166529254.119448.216990@n67g2000cwd.googlegroups.com...
> Hi,
>
> I am using VBA to open an excel file (week 40). Is there any way to
> use VBA to open the last saved file (week 41, 42 etc)? I want to use
> the most recent file to populate my data tables.
>
> Many thanks
>
> nick
>