Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.
Private Sub CommandButton1_Click() MsgBox "You selected " & GetImportFileName CommandButton1.Picture = GetImportFileName '<--RUN TIME ERROR '424' End Sub Function GetImportFileName() As Variant Dim Filt As String Dim FilterIndex As Integer Dim FileName As Variant Dim Title As String ' Set up list of file filters Filt = "Text Files (*.txt),*.txt," & _ "Lotus Files (*.prn),*.prn," & _ "Comma Separated Files (*.csv),*.csv," & _ "ASCII Files (*.asc),*.asc," & _ "All Files (*.*),*.*" ' Display *.* by default FilterIndex = 5 ' Set the dialog box caption Title = "Select a File to Import" ' Get the file name FileName = Application.GetOpenFilename _ (FileFilter:=Filt, _ FilterIndex:=FilterIndex, _ Title:=Title) ' Exit if dialog box canceled If FileName = False Then MsgBox "No file was selected." Exit Function End If ' Display full path and name of the file GetImportFileName = FileName End Function
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
|Pivot table - average if not zero||2||27|
|how to extract unique list from two columns||9||34|
|Getting an "Application-defined or object-defined error" warning when refreshing a web query||3||32|
|Do you know how to compute seconds into hours, minutes and seconds via an Excel macro?||2||29|