LegalEagle
LegalEagle

Reputation: 117

Intellisense not working in VSTO app for Visual Studio 2017

I have a VSTO Excel plugin I am creating in Visual Studio 2017.

At the top of the module above all subroutines, I have this line:

Public xlApp = Globals.ThisAddIn.Application

In several of the subroutines in this same module, I use xlApp.Activecell.Value in several places. As I was originally writing the subs, Intellisense would pop up after typing xlApp. and would give me all the expected options. Something changed, however.

Now when I type xlApp. I only see Equals, GetHashCode, GetType, and ToString in the Intellisense. If I type xlApp.ActiveCell.Value despite the lack of intellisense, it does not throw a compile or build error, and the app runs as expected although it's much harder to continue writing additional features.

Can anyone direct me as to what I might look for to find the culprit?

I still get the expected Intellisense options when I type Globals.ThisAddIn.Application. so I know it's still available in the project, but it's like it's not recognizing the "xlApp" alias.

Upvotes: 0

Views: 147

Answers (1)

Sara Liu - MSFT
Sara Liu - MSFT

Reputation: 6218

Please use this statement: Public xlApp As Excel.Application = Globals.ThisAddIn.Application

Then when you type xlApp., the member list like the following: enter image description here

Upvotes: 1

Related Questions