Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Opening a file command doesn't work
We have a VB program and runs from one file and tries to open another file
which is located in the same directory. The other file is called "Updatefile.xls." THis macro runs fine at one computer that has Excel 2003, but doesn't work on another computer that has Excel 2000. It will open on the Excel 2000 computer if you provde the entire path. Is this an Excel version problem or something else? If not, why does it run on one computer (opening the 2nd file), but not on the other. If so, is there a way to provide the path programmatically (we do not know where various users of this program will put their files?) Thanks for all your help |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Opening a file command doesn't work
Hi,
try GetFile: ''' ------------------------------------------- Function GetFile() As String Dim fd As Office.FileDialog Dim action As Long Set fd = Application.FileDialog(msoFileDialogFilePicker) With fd .AllowMultiSelect = False .ButtonName = "Select file" .Title = "Select Update file" .Filters.Clear .Filters.Add "Excel Files", "*.xls" .InitialFileName = "Updatefile.xls" action = .Show If action = 0 Then ''' user cancelled GetFile = "" Else GetFile = CStr(.SelectedItems(1)) End If End With End Function '''------------------------------------------------ -- Regards, Sébastien <http://www.ondemandanalysis.com <http://www.ready-reports.com "Andyjim" wrote: We have a VB program and runs from one file and tries to open another file which is located in the same directory. The other file is called "Updatefile.xls." THis macro runs fine at one computer that has Excel 2003, but doesn't work on another computer that has Excel 2000. It will open on the Excel 2000 computer if you provde the entire path. Is this an Excel version problem or something else? If not, why does it run on one computer (opening the 2nd file), but not on the other. If so, is there a way to provide the path programmatically (we do not know where various users of this program will put their files?) Thanks for all your help |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Opening Excel by double-clicking a file doesn't work! | Excel Discussion (Misc queries) | |||
Opening Excel 2003 file in Excel 2007: Links do not work | Excel Discussion (Misc queries) | |||
VBA - opening files with Shell command | Excel Programming | |||
Work Command | Excel Discussion (Misc queries) | |||
In addition to previous question, if opening an Excel file in NON-read-only mode, would the macros on the worksheets work as well? | Excel Programming |