View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Steph Steph is offline
external usenet poster
 
Posts: 46
Default Default File path

Hi everyone. Below is a piece of code that allows the user to browse to a
location on the network and select a file to open. Is there a way to
default to a specific path? For example, default to C:\Documents and
Settings\All Users. Thanks!


Sub GetDataFile()
Dim v As Variant, i As Long, bk As Workbook

Application.ScreenUpdating = False
Application.DisplayAlerts = False

v = Application.GetOpenFilename(MultiSelect:=False)
If Not IsArray(v) Then Exit Sub
For i = LBound(v) To UBound(v)
Set bk = Workbooks.Open(v(i))