I have a macro that I’ve been using for years which all of a sudden started giving the ‘Object variable or With block variable not set’ error.
To try to isolate the issue I created this test:
Private Sub test()
Debug.Print ActiveWorkbook.Name
End Sub
I’m getting the same Object error (Run-Time error ’91’) and cannot think of any reason this should be happening when I’m not even using a variable in the test. I noticed it’s only happening on one specific .XLS file but this file is emailed to me every month and I’ve used the same macro to process these files for years. I created a new .XLS file on my desktop, same location as the problem file, and am able to print ActiveWorkbook.Name