ipbr21054
Well-known Member
- Joined
- Nov 16, 2010
- Messages
- 5,832
- Office Version
- 2007
- Platform
- Windows
Morning all,
I am using the code supplied below which works fine.
When the code operates i am taken to the worksheet where i currently see the message "LEADERBOARD" of which i need to click OK
What needs to be done so i dont have to click OK,i dont even need to see this message BUT i do need to see the message if the file is not found etc.
Please advise thanks.
I am using the code supplied below which works fine.
When the code operates i am taken to the worksheet where i currently see the message "LEADERBOARD" of which i need to click OK
What needs to be done so i dont have to click OK,i dont even need to see this message BUT i do need to see the message if the file is not found etc.
Please advise thanks.
Code:
Sub Openworkbook_Click()
Dim xWb As Workbook
Dim wbName As String
On Error Resume Next
Set xWb = Workbooks.Open("C:\Users\Ian\Desktop\REMOTES ETC\DR\HONDA SOLD ITEMS.xlsm")
wbName = xWb.Name
If Err.Number <> 0 Then
MsgBox "This workbook does not exist!", vbInformation, "HONDA SOLD ITEMS"
Err.Clear
Else
MsgBox "LEADERBOARD!", vbInformation, "HONDA SOLD ITEMS"
End If
End Sub