Aug 16, 2009

How to Open Workbook

Sub showFile()

fn = Dir("C:\update\" & "*.xls") ' the first file name in the folder
While Len(fn) > 0
MsgBox fn

' Open the file
Application.Workbooks.Open ("C:\update\" & fn)

fn = Dir ' the next file name in the folder
Wend
End Sub


You have files located at folder update in C drive.
You want get a list of files in this update folder.
then you open every file you found in this folder.

No comments: