×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Stopping a macro to allow you to browse for a file

Stopping a macro to allow you to browse for a file

Stopping a macro to allow you to browse for a file

(OP)
What (if any ) Command is there that will allow a user that runs a macro to browse for a certain file and not use the one that was recorded in the macro intially.

Did you follow that question?

Thanks in advance!

Scott Baugh, CSWP
3DVision Technologies

www.3dvisiontech.com
www.scottjbaugh.com
FAQ731-376

RE: Stopping a macro to allow you to browse for a file

File browsing is not directly licensed in VBA.  There are workarounds using Windows API (i.e. "Declare Function...").  Not quite an advanced concept, but not for the casual programmer, either.

Download and dissect the "Copy Custom Info" macro from my website at <http://www.esoxrepublic.com/freeware/>.  
Review the FileNameToOpen function and its related calls.  There are some comments referring to other web resources.

OT: 3rd time in 2 days I used this macro for an example!

RE: Stopping a macro to allow you to browse for a file

(OP)
Thanks Tick!! I will check out the file

OT: Be glad you have it or you would be retyping this time and time again.

Best Regards,

Scott Baugh, CSWP
3DVision Technologies

www.3dvisiontech.com
www.scottjbaugh.com
FAQ731-376

RE: Stopping a macro to allow you to browse for a file

Do you have VB version 6 or .NET?  VB will give you a nice easy interface for browsing files as part of the standard form controls.

RE: Stopping a macro to allow you to browse for a file

Scott,

You can also look at thread559-55331

Regards,

Regg

RE: Stopping a macro to allow you to browse for a file

This is not a browser, but will let you specify a folder and a filename:

workDir = InputBox("title1", "title2", "\\server\folder1\folder2\...\") 'the 3rd field is the default folder name

filename = InputBox("title1", "title2", "default file name")

filename = workDir & filename & ".extension"
        
ChDir (workDir)

Open filename For Output As 1
Print #1, "insert the the information"
Close #1

I hope that helps.

Regards

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources