ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Using VBA to open an excel file (https://www.excelbanter.com/excel-programming/379680-using-vba-open-excel-file.html)

[email protected]

Using VBA to open an excel file
 
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


Nick Hodge

Using VBA to open an excel file
 
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
DTHIS
www.nickhodge.co.uk


wrote in message
oups.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




All times are GMT +1. The time now is 09:43 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com