Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Is there a way to set the path for Application.GetSaveAsFilename. The
dialogue opens at "My Documents". I would like for it to open at a folder on a server (not designated as a drive since different users may have the address mapped differently) |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You can use a windows api function that changes the drive. In fact, this works
with mapped drives, too: Option Explicit Private Declare Function SetCurrentDirectoryA Lib _ "kernel32" (ByVal lpPathName As String) As Long Sub ChDirNet(szPath As String) Dim lReturn As Long lReturn = SetCurrentDirectoryA(szPath) If lReturn = 0 Then Err.Raise vbObjectError + 1, "Error setting path." End Sub Sub testme01() Dim myFileName As Variant Dim myCurFolder As String Dim myNewFolder As String myCurFolder = CurDir myNewFolder = "\\share\folder1\folder2" On Error Resume Next ChDirNet myNewFolder If Err.Number < 0 Then 'what should happen MsgBox "Please change to your own folder" Err.Clear End If On Error GoTo 0 myFileName = Application.GetSaveAsFilename(filefilter:="Excel Files, *.xls") ChDirNet myCurFolder If myFileName = False Then Exit Sub 'user hit cancel End If 'do your stuff... End Sub JR_06062005 wrote: Is there a way to set the path for Application.GetSaveAsFilename. The dialogue opens at "My Documents". I would like for it to open at a folder on a server (not designated as a drive since different users may have the address mapped differently) -- Dave Peterson |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
See example 6
http://www.rondebruin.nl/copy3.htm#select I use ChDirNet there -- Regards Ron De Bruin http://www.rondebruin.nl "JR_06062005" wrote in message ... Is there a way to set the path for Application.GetSaveAsFilename. The dialogue opens at "My Documents". I would like for it to open at a folder on a server (not designated as a drive since different users may have the address mapped differently) |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Help with getsaveasfilename | Excel Discussion (Misc queries) | |||
Help with GetSaveAsFilename | Excel Programming | |||
GetSaveasFileName | Excel Programming | |||
GetSaveAsFileName | Excel Programming | |||
GetSaveAsFilename | Excel Programming |