Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does VBA editor opens Outlook?

Tags:

excel

vba

vbe

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").

like image 918
mathiasfk Avatar asked Nov 08 '22 19:11

mathiasfk


1 Answers

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.

like image 176
TheGuyOverThere Avatar answered Dec 13 '22 13:12

TheGuyOverThere