Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 359
  • Last Modified:

VB.net Excel Add-in Running a procedure behind a UserControl from a button on the ribbon

Hi

I need to run the following procedure "Test" behind UserControl1 (a Custom Task Pane)
from a button click on my Ribbon. How do I do this? I tried changing the code below to "Public Shared Sub Test" but got the error: "Me is not valid within an instance method"

Public Class UserControl1

        Public  Sub Test
               Me.TreeView1.Nodes.Clear.........
.
0
Murray Brown
Asked:
Murray Brown
  • 2
  • 2
1 Solution
 
CodeCruiserCommented:
Is treeview1 on the user control?
0
 
Murray BrownMicrosoft Cloud Azure/Excel Solution DeveloperAuthor Commented:
Hi. Yes it is.
0
 
CodeCruiserCommented:
You need to have a reference of the user control in your button. Not sure where you can get that. At class level somewhere.
0
 
Murray BrownMicrosoft Cloud Azure/Excel Solution DeveloperAuthor Commented:
thanks for the help
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now