Sometimes when I'm inspecting some variable on my excel macro, Outlook opens up by itself. This is pretty annoying since I don't even use Outlook nor have it configured. What is happening here?
I'm using Office 2016.
Edit: I don't think this has any to do with the actual macro, but anyway, here it goes:
Sub duplicateSheets()
Dim i As Integer
For i = 1 To 3
ThisWorkbook.Sheets("classes").Copy _
After:=ThisWorkbook.Sheets(ThisWorkbook.Sheets.Count)
ThisWorkbook.Sheets("pivot").Copy _
After:=ThisWorkbook.Sheets(ThisWorkbook.Sheets.Count)
Next
End Sub
Outlook opens when I'm inspecting ThisWorkbook.Sheets("classes")
.
I've had something similar happen to me before only with Access. My Excel VBA code never interacted with Access but it would still open up. Never got any errors from it, but I agree, it is rather annoying to have to close it every time.
After searching around I found that it was because I had the Microsoft Access 15.0 Object Library
reference turned on. I guess some property or method that I would call from my Excel VBA would somehow trigger something in the Access Library and it would open up the application.
See if you have any Library references to Outlook
enabled and turn them off, it might fix the issue you are having.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With