+ Reply to Thread
Results 1 to 5 of 5

.InitialFileName property seems to be ignored when calling App.Dialogs(xlDialogOpen)

  1. #1
    Registered User
    Join Date
    09-02-2009
    Location
    Edinburgh, Scotland
    MS-Off Ver
    Excel 2007
    Posts
    77

    .InitialFileName property seems to be ignored when calling App.Dialogs(xlDialogOpen)

    Hi folks,

    Have recently transitioned from XL2003 to 2007 and am in the process of updating a number of add-ins for which I am responsible.

    One of these makes use of Application.Dialogs(xlDialogOpen) to allow the user to select a file from a predefined network folder.

    In XL2003, the following code worked fine
    Please Login or Register  to view this content.
    (where initialPath is a string containing the full UNC path with a trailing backslash, e.g. \\server\share\somefolder\someotherfolder\)

    The above doesn't work in 2007 (the file open dialog displays but does not default to initialPath; instead it defaults to the Excel program folder on the user's C: drive, i.e. C:\Program Files (x86)\Microsoft Office\Office12).

    I have tried the following to no effect:

    Please Login or Register  to view this content.
    I have also tried adding *.* and *.xl* to the path, as well as removing the trailing backslash, but the result is always the same, i.e. defaults to XL program folder.

    Any guidance would be greatly appreciated.

  2. #2
    Registered User
    Join Date
    09-02-2009
    Location
    Edinburgh, Scotland
    MS-Off Ver
    Excel 2007
    Posts
    77

    Re: .InitialFileName property seems to be ignored when calling App.Dialogs(xlDialogOpen)

    Bump... anyone?

  3. #3
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,434

    Re: .InitialFileName property seems to be ignored when calling App.Dialogs(xlDialogOpen)

    Just tested in xl2003, 2007 and 2010. All open the dialog at the specified network folder.

    Do you have the latest service pack and updates for 2007 applied?
    Cheers
    Andy
    www.andypope.info

  4. #4
    Registered User
    Join Date
    09-02-2009
    Location
    Edinburgh, Scotland
    MS-Off Ver
    Excel 2007
    Posts
    77

    Re: .InitialFileName property seems to be ignored when calling App.Dialogs(xlDialogOpen)

    Cheers Andy. Seems you may have the likely suspect. After a little further testing of my own it seems my XL2007 won't even allow me to default the dialog to a local folder, never mind a network one. My version of Excel.exe is 12.0.4518.1014, which is the original release, so I'll get IT here to update it if I can and post back with an update.

  5. #5
    Registered User
    Join Date
    09-02-2009
    Location
    Edinburgh, Scotland
    MS-Off Ver
    Excel 2007
    Posts
    77

    Re: .InitialFileName property seems to be ignored when calling App.Dialogs(xlDialogOpen)

    Patched to SP3 and now behaving as expected. Much obliged Andy - thanks!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1