Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8574283
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T19:26:23+00:00 2026-06-11T19:26:23+00:00

I write a script like this: Sub Button_Click() objFile = Application.GetOpenFilename(fileFilter:=All Files (* .

  • 0

I write a script like this:

Sub Button_Click()
    objFile = Application.GetOpenFilename(fileFilter:="All Files (* . *) , * . * ") ' choose load path
    .....

    Call main_function
End Sub

This is the script of an Excel macro button to let the user browse the file. Actually, I want use this to load an Excel file and use that Excel file’s data in the main_function(the current excel).

How can I do this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T19:26:24+00:00Added an answer on June 11, 2026 at 7:26 pm

    Guess you want to restrict the user to Excel only, so I modified the filter for you

    Dim pathString As String
    Dim resultWorkbook As Workbook
    Dim found As Boolean
    pathString = Application.GetOpenFilename(fileFilter:="All Files (* . xl*) , *.xl* ")
    
    ' check if it's already opened
    For Each wb In Workbooks
        If InStr(pathString, wb.Name) > 0 Then
            Set resultWorkbook = wb
            found = True
            Exit For
        End If
    Next wb
    
    If Not found Then
        Set resultWorkbook = Workbooks.Open(pathString)
    End If
    
    ' then you can use resultWorkbook as a reference to the Excel Workbook Object
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to write a python script that takes record data like this
I would like to write a script which will edit multiple XML files, I
I'd like to write a parsing script in Perl that prints all the interface
I'd like to write a stored procedure in SQL 2005 to script all my
I am trying to write a shell script to delete all the sub directories
I know how to write a callback function with coffee-script,like this: test1.coffee exports.cube=(callback)-> callback(5)
Is Delphi have any ability to write script of IDE actions? I would like
I am trying to write a script to patch our mysql database. Something like
I'd like to write an Ant script that calls an external utility (Inkscape, in
I have to write a bash script that makes lot of things. I'd like

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.