View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Danny Boy via OfficeKB.com Danny Boy via OfficeKB.com is offline
external usenet poster
 
Posts: 14
Default Run-time error '1004'

Hi Ken

This script will allow you to select the file you wish to open, if the format
you want ins't csv then change it to desired format

Application.DisplayAlerts = False
Application.ScreenUpdating = False

fileToOpen = Application _
.GetOpenFilename("Comma Delimited (*.csv), *.csv")
If fileToOpen < False Then
TextBox2.Value = "Opening " & fileToOpen
Else
Exit Sub
End If

Workbooks.OpenText Filename:="" & fileToOpen
DoEvents

--
Message posted via http://www.officekb.com