20 | 09 | 2017

Open Excel File From Macro

Code below displays a file dialog box. Select a file and open upon enter.  

Sub OpenExcelFileDialog()
    '*** Code from VisibleVisual.com ********
    Dim XLFile As Variant
    'Open Excel Dialog Form
    XLFile = Application.GetOpenFilename("Excel Files (*.xl*)," & _
    "*.xl*", 1, "Select Excel File", "Open", False)
    'Exit on Cance;
    If TypeName(vFile) = "Boolean" Then
        Exit Sub
    End If
    'Open the File
    Workbooks.Open vFile
End Sub

Sign up now and upload your code to the website.

Help us to continue.....
Articles View Hits
Latest Articles