lezawang
Well-known Member
- Joined
- Mar 27, 2016
- Messages
- 1,805
- Office Version
- 2016
- Platform
- Windows
Hi
The code below is going to run no problem to my surprise. It will also run without typing Application. Now I am confused. I know to access a workbook I need to go through the workbook collection like the following
So why the code below is OK? Thank you very much.
The code below is going to run no problem to my surprise. It will also run without typing Application. Now I am confused. I know to access a workbook I need to go through the workbook collection like the following
Code:
msgbox(application.workbooks(1).name)
So why the code below is OK? Thank you very much.
Code:
Sub wk1()
MsgBox (Application.ThisWorkbook.Name)
MsgBox (Application.ActiveWorkbook.Name)
End Sub