VBA How to open browser in an specific path (1 Viewer)

AccOUCH

Registered User.
Local time
Today, 13:32
Joined
Sep 27, 2018
Messages
25
Hi! I'm trying to open the file browser from VBA with this code:

Code:
    Dim S As String
    S = OpenCommDlg("Magazine.txt")

And It's ok but it opens the window of the "C:\A\B" Path
And I want it to open "C:" path

No way to change it giving that path to the function...
Any idea?
 

theDBguy

I’m here to help
Staff member
Local time
Today, 13:32
Joined
Oct 29, 2018
Messages
21,454
Hi. Can you post the code for OpenCommDlg()?
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 15:32
Joined
Feb 28, 2001
Messages
27,146
Sounds like it is trying to open in a default directory, perhaps?

I'm with theDBGuy - we need to see the OpenCommDlg code to know why it is doing what it is doing - and in particular why you think you CAN'T give it the explicit path.
 

AccOUCH

Registered User.
Local time
Today, 13:32
Joined
Sep 27, 2018
Messages
25
Thaks guys, you gave the clue to solve this.
Function OpenCommDlg(ByVal DirBusqueda As String), far from being a default VBA Function, is a Function added to the project by another programmer. Soo...I only had to change the default path created there to achieve my aim.
 

theDBguy

I’m here to help
Staff member
Local time
Today, 13:32
Joined
Oct 29, 2018
Messages
21,454
Hi. Glad to hear you got it sorted out. Good luck with your project.
 

Users who are viewing this thread

Top Bottom