LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 811
Default How do I set a default path when using Application.GetOpenFilename

You can use the SetCurrentDirectoryAPI to set the current directory to
a UNC path. Here's a quick procedure that will do this:

Private Declare Function GetCurrentDirectoryA Lib "kernel32" _
(ByVal nBufferLength As Long, ByVal lpBuffer As String) As Long

Public Sub SetUNCPath(ByVal szPathToSet As String)
SetCurrentDirectoryA szPathToSet
End Sub

Despite the name, it works on regular drive\path strings as well.

--
Rob Bovey, MCSE, MCSD, Excel MVP
Application Professionals
http://www.appspro.com/

* Please post all replies to this newsgroup *
* I delete all unsolicited e-mail responses *


"pkohler " wrote in message
...
One Clarifying point.

The path that I want to open is a network path.

I.E. \\ShareName\Folder\etc


---
Message posted from http://www.ExcelForum.com/



 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I set a default path when using Application.GetOpenFilename pkohler[_7_] Excel Programming 2 July 13th 04 07:17 PM
GetOpenFilename Dialog default path Arthlan Excel Programming 1 June 3rd 04 09:19 PM
path names in getopenfilename Paul Shepherd Excel Programming 6 January 28th 04 10:59 AM
GetopenFilename default path Srinath Excel Programming 5 October 10th 03 04:47 PM
Application.GetOpenFileName ptrowe Excel Programming 2 September 11th 03 12:54 PM


All times are GMT +1. The time now is 02:59 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"