How To Open Excel File Using Macro

Imagine this condition; We are in the middle of doing something using Excel VBA macro, then we want the macro to automatically show the File Open dialog box to make us (user) able to choose another Excel file to be opened by Excel.

Got the picture? Below is vba procedure that do exactly like that, show the File Open dialog box, and open the Excel file selected by user.

Sub OpenExcelFile()

    Dim vFile As Variant

    'Showing Excel Open Dialog Form
    vFile = Application.GetOpenFilename("Excel Files (*.xl*)," & _
    "*.xl*", 1, "Select Excel File", "Open", False)

    'If Cancel then exit
    If TypeName(vFile) = "Boolean" Then
        Exit Sub
    End If

    'Open selected file
    Workbooks.Open vFile

End Sub
This entry was posted in Excel VBA Function and tagged , , , , , , , , , , , , , . Bookmark the permalink.

1,184 Responses to How To Open Excel File Using Macro

  1. Pingback: image

  2. Pingback: cuisinart automatic ice cream maker

  3. Pingback: fun times

  4. Pingback: maryland internet

  5. Pingback: How to Tie a Tie

  6. Pingback: Juegos de fubol callejero

  7. Pingback: Safety Label Changes

  8. Pingback: wood snow fence

  9. Pingback: baby contest

  10. Pingback: Peripheral

  11. Pingback: Software

  12. Pingback: anti aging cream

  13. Pingback: beat maker

  14. Pingback: used sub zero refrigerator prices

  15. Pingback: check advance

  16. Pingback: Immobilier Quimper

  17. Pingback: bad credit unsecured personal loan

  18. Pingback: start online business free

  19. Pingback: look into skate ski

  20. Pingback: "best laundry detergent

  21. Pingback: austin search engine optimization

  22. Pingback: understandable

  23. Pingback: fibersource tube feeding

  24. Pingback: http://www.casquebluetooth.org/

  25. Pingback: "fun tasticdental

  26. Pingback: gogo games

  27. Pingback: http://www.la-mutuelle.com/

  28. Pingback: tv live

  29. Pingback: fast car insurance

  30. Pingback: servis char

  31. Pingback: promoting and celebrating Virginia creativity

  32. Pingback: read about payday advances

  33. Pingback: Red Wines

  34. Pingback: duluth tree removal

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>