TheWennerWoman
Active Member
- Joined
- Aug 1, 2019
- Messages
- 270
- Office Version
- 365
- Platform
- Windows
Hello,
I have two workbooks open (as well as my file running the macro).
I am trying to reference one of them with
But it errors with "Object variable or With block variable not set"
What am I doing wrong?
I have two workbooks open (as well as my file running the macro).
I am trying to reference one of them with
Code:
Dim shtData As Worksheet
Dim wb1 As Workbook
Set shtData = wb1.Sheets(3) '<---errors here
But it errors with "Object variable or With block variable not set"
What am I doing wrong?