Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
I need a macro that allows the user to select the file. I have figured out to
write a macro for specific path however, as this workbook will go to many differnt users that will have differnt names and paths for the file. Any help would be awsome. Thank in advance. -CM |
#2
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
One way
There is no code to test if the workbook is open in this example 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 Workbooks.Open (FName) End If ChDrive SaveDriveDir ChDir SaveDriveDir End Sub -- Regards Ron de Bruin http://www.rondebruin.nl/tips.htm "Chris" wrote in message ... I need a macro that allows the user to select the file. I have figured out to write a macro for specific path however, as this workbook will go to many differnt users that will have differnt names and paths for the file. Any help would be awsome. Thank in advance. -CM |
#3
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Your A PRO!
"Ron de Bruin" wrote: One way There is no code to test if the workbook is open in this example 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 Workbooks.Open (FName) End If ChDrive SaveDriveDir ChDir SaveDriveDir End Sub -- Regards Ron de Bruin http://www.rondebruin.nl/tips.htm "Chris" wrote in message ... I need a macro that allows the user to select the file. I have figured out to write a macro for specific path however, as this workbook will go to many differnt users that will have differnt names and paths for the file. Any help would be awsome. Thank in advance. -CM |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How can second, third user sign excel file containing macro | Excel Discussion (Misc queries) | |||
Macro stop if file in use by other user? | Excel Discussion (Misc queries) | |||
File is already open by user X | Excel Discussion (Misc queries) | |||
Macro to Sort automatically when file/save is selected | Excel Discussion (Misc queries) | |||
not being prompted that user has file open | Excel Discussion (Misc queries) |