View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
jason jason is offline
external usenet poster
 
Posts: 104
Default MUST BE POSSIBLE !! ..........

Thanks to everybody for help
(Like the little touch of restoring initial settings at the end of your routine Ron)

thanks again
jason



"Ron de Bruin" wrote in message ...
Hi Jason

Here is a example that is also using ChDrive

Sub test()
Dim SaveDriveDir As String, MyPath As String
Dim FName As Variant

SaveDriveDir = CurDir
MyPath = "C:\Data"
ChDrive MyPath
ChDir MyPath

FName = Application.GetOpenFilename(filefilter:="Excel Files, *.xls")

If FName = False Then
'do nothing
Else
'your code
End If

ChDrive SaveDriveDir
ChDir SaveDriveDir
End Sub


--
Regards Ron de Bruin
http://www.rondebruin.nl


"jason" wrote in message om...
...I want to use the GetOpenFile method to set a variable that is an
excel file i.e:

MyAllocPathway = Application.GetOpenFilename("Excel Files (*.xls),
*.xls, Add- in Files (*.xla), *.xla", 1, "Select Excel you wish to
attach")

this works ok

Is it possible so that whenever this is actioned it opens with the
contents of a specific folder?

I've tried putting this infront of the above line, but itdoesn't seem
to work:

ChDir ("I:\Fin\Val data\OLA\OLAB figures (Weekly)\")

Any help greatly appreciated,
Jason