Solved

VB.net Excel Add-in Cell interior color eg Yellow

Posted on 2013-06-19
2
485 Views
Last Modified: 2013-06-19
Hi

In my Excel Add-in I have a procedure where a color is passed in as a string,
why doesn't the following code work?

Sub oColor(ByVal strColor As String)
        Globals.ThisAddIn.Application.Selection.Interior.color = strColr
End Sub
0
Comment
Question by:murbro
2 Comments
 
LVL 80

Accepted Solution

by:
byundt earned 500 total points
Comment Utility
Excel is expecting a Long for the .Color property, not a string. You can generate the value of that Long by using the color picker (and then interrogating the color of the active cell) or by using the RGB function.
0
 

Author Closing Comment

by:murbro
Comment Utility
Thanks
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
This code takes an Excel list of URL’s and adds a header titled “URL List”. It then searches through all URL’s in column “A”, looking for duplicates. When a duplicate is found, it is moved to the top of the list. The duplicate URL’s are then highlig…
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now