Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I would like to automate the file open box/window. My code is:
On the Before Double-Click of the sheet: ------------------------------ Dim vChDir as String vChDir = ActiveCell.Value ChDrive Mid(vChDir,1,2) ChDir vChDir ------------------------------ I tried SendKeys ("%FO") ... but that does not work. How do you open the File/Open box? Thank you for your help. Steven |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Steven
Use GetOpenFilename Sub test() Dim FName As Variant Dim wb As Workbook Dim MyPath As String Dim SaveDriveDir As String SaveDriveDir = CurDir MyPath = ThisWorkbook.Path ChDrive MyPath ChDir MyPath FName = Application.GetOpenFilename(filefilter:="Excel Files (*.xls), *.xls") If FName < False Then Set wb = Workbooks.Open(FName) MsgBox "your code" wb.Close End If ChDrive SaveDriveDir ChDir SaveDriveDir End Sub -- Regards Ron de Bruin http://www.rondebruin.nl "Steven" wrote in message ... I would like to automate the file open box/window. My code is: On the Before Double-Click of the sheet: ------------------------------ Dim vChDir as String vChDir = ActiveCell.Value ChDrive Mid(vChDir,1,2) ChDir vChDir ------------------------------ I tried SendKeys ("%FO") ... but that does not work. How do you open the File/Open box? Thank you for your help. Steven |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Look at GetOpenFilename in VBA help.
-- HTH Bob Phillips (replace somewhere in email address with gmail if mailing direct) "Steven" wrote in message ... I would like to automate the file open box/window. My code is: On the Before Double-Click of the sheet: ------------------------------ Dim vChDir as String vChDir = ActiveCell.Value ChDrive Mid(vChDir,1,2) ChDir vChDir ------------------------------ I tried SendKeys ("%FO") ... but that does not work. How do you open the File/Open box? Thank you for your help. Steven |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
hyperlink open new window | Excel Discussion (Misc queries) | |||
How I can I open a small window within window | Excel Discussion (Misc queries) | |||
OPen an DOS WIndow | Excel Discussion (Misc queries) | |||
open new window | Excel Discussion (Misc queries) | |||
Excel workbook does not open in open window on desktop | Excel Discussion (Misc queries) |