Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Open Dialogue Box to a certain folder?????

Does anyone know how to open a dialogue box that will open to a
specific folder of my choosing?? I am able to open the dialogue box
but it defaults to the last folder that was used.

The code I am using looks like this:

'Filt = "All Files (*.*),*.*"
'Title = "Import Routine"
'FileName = Application.GetOpenFilename(Filt, 5, Title, True)

Thanks in Advance

G-.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 172
Default Open Dialogue Box to a certain folder?????

Not tested but I think you need to set the Application.DefaultFilePath which
specifies where Excel goes to find a file when opening.

Cheers
N


"German" wrote in message
om...
Does anyone know how to open a dialogue box that will open to a
specific folder of my choosing?? I am able to open the dialogue box
but it defaults to the last folder that was used.

The code I am using looks like this:

'Filt = "All Files (*.*),*.*"
'Title = "Import Routine"
'FileName = Application.GetOpenFilename(Filt, 5, Title, True)

Thanks in Advance

G-.





----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! 100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 172
Default Open Dialogue Box to a certain folder?????

Sorry have now tested and that is not it!!
Will continue to search for a solution.
Cheers
N

"Nigel" wrote in message
...
Not tested but I think you need to set the Application.DefaultFilePath

which
specifies where Excel goes to find a file when opening.

Cheers
N


"German" wrote in message
om...
Does anyone know how to open a dialogue box that will open to a
specific folder of my choosing?? I am able to open the dialogue box
but it defaults to the last folder that was used.

The code I am using looks like this:

'Filt = "All Files (*.*),*.*"
'Title = "Import Routine"
'FileName = Application.GetOpenFilename(Filt, 5, Title, True)

Thanks in Advance

G-.





----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet

News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! 100,000

Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption

=---




----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! 100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 413
Default Open Dialogue Box to a certain folder?????

Might this be of use?

ChDrive "C"
ChDir "C:\Something\something else\etc\"
vFilename = Application.GetOpenFilename _
(FileFilter:="Excel Files (*.xls),*.xls", _
MultiSelect:=True) 'MultiSelect to let user choose
'more than one file
If TypeName(vFilename) = "Boolean" Then
MsgBox "No file was selected"
Exit Sub
Else
'do your stuff here.

Of course this does not stop the user browsing to
anothe folder!

Regards.

"German" wrote in message
om...
Does anyone know how to open a dialogue box that will open to a
specific folder of my choosing?? I am able to open the dialogue box
but it defaults to the last folder that was used.

The code I am using looks like this:

'Filt = "All Files (*.*),*.*"
'Title = "Import Routine"
'FileName = Application.GetOpenFilename(Filt, 5, Title, True)

Thanks in Advance

G-.



---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.542 / Virus Database: 336 - Release Date: 18/11/2003


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Open Dialogue Box to a certain folder?????

That is an awesome idea, but I am not using a structure of
"C:\something\something else\ etc\", I have to use something like
"\\somehting\something else\" any ideas on how to do that, the problem
is that all users might not have same mapping.

Thanks,

G-.



"Stuart" wrote in message ...
Might this be of use?

ChDrive "C"
ChDir "C:\Something\something else\etc\"
vFilename = Application.GetOpenFilename _
(FileFilter:="Excel Files (*.xls),*.xls", _
MultiSelect:=True) 'MultiSelect to let user choose
'more than one file
If TypeName(vFilename) = "Boolean" Then
MsgBox "No file was selected"
Exit Sub
Else
'do your stuff here.

Of course this does not stop the user browsing to
anothe folder!

Regards.

"German" wrote in message
om...
Does anyone know how to open a dialogue box that will open to a
specific folder of my choosing?? I am able to open the dialogue box
but it defaults to the last folder that was used.

The code I am using looks like this:

'Filt = "All Files (*.*),*.*"
'Title = "Import Routine"
'FileName = Application.GetOpenFilename(Filt, 5, Title, True)

Thanks in Advance

G-.



---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.542 / Virus Database: 336 - Release Date: 18/11/2003



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default Open Dialogue Box to a certain folder?????

Netscape crashed just as I hit the Send button (sorry about any duplicate post):

here's a post from Rob Bovey/Tom Ogilvy:

========

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

Example of usage

Sub GetFile()
On Error GoTo ErrHandler
ChDirNet "\\LOGD0FILES\OGILVTW\Docs\Temp"
Exit sub
ErrHandler:
MsgBox "Couldn't set path"
End Sub

Use like ChDir and ChDrive combined.


German wrote:

That is an awesome idea, but I am not using a structure of
"C:\something\something else\ etc\", I have to use something like
"\\somehting\something else\" any ideas on how to do that, the problem
is that all users might not have same mapping.

Thanks,

G-.

"Stuart" wrote in message ...
Might this be of use?

ChDrive "C"
ChDir "C:\Something\something else\etc\"
vFilename = Application.GetOpenFilename _
(FileFilter:="Excel Files (*.xls),*.xls", _
MultiSelect:=True) 'MultiSelect to let user choose
'more than one file
If TypeName(vFilename) = "Boolean" Then
MsgBox "No file was selected"
Exit Sub
Else
'do your stuff here.

Of course this does not stop the user browsing to
anothe folder!

Regards.

"German" wrote in message
om...
Does anyone know how to open a dialogue box that will open to a
specific folder of my choosing?? I am able to open the dialogue box
but it defaults to the last folder that was used.

The code I am using looks like this:

'Filt = "All Files (*.*),*.*"
'Title = "Import Routine"
'FileName = Application.GetOpenFilename(Filt, 5, Title, True)

Thanks in Advance

G-.



---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.542 / Virus Database: 336 - Release Date: 18/11/2003


--

Dave Peterson

Reply
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
Preview in Open Dialogue Juli Excel Discussion (Misc queries) 4 May 31st 07 09:21 PM
When i open excel on the start dialogue, it does not open. lemon8 Setting up and Configuration of Excel 1 December 14th 05 05:37 AM
Need VBA code for "Open Dialogue" box Brent E Excel Discussion (Misc queries) 2 February 8th 05 04:23 AM
Need VBA assistance for Excel Open Dialogue box Brent E Excel Discussion (Misc queries) 2 February 7th 05 07:41 PM
Opening Open File Dialogue box from Excel97 Scampa7[_5_] Excel Programming 0 November 19th 03 08:34 PM


All times are GMT +1. The time now is 12:21 AM.

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

About Us

"It's about Microsoft Excel"