Opening a Excel File Using VBA
Dim strFileToOpen As Variant, HR_Raw_wk As Workbook
strFileToOpen = Application.GetOpenFilename _
(Title:="Please choose HR File which you recieved", _
FileFilter:="Excel Files *.xls* (*.xls*),")
If InStr(1, "HRfilerequest", strFileToOpen) > 0 Or strFileToOpen = False Then
MsgBox "No/Wrong file selected.", vbExclamation, "Sorry!"
Exit Sub
Else
Set HR_Raw_wk = Workbooks.Open(strFileToOpen, 0)
End If
Comments
Post a Comment