Solved

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

Posted on 2013-06-19
2
500 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 81

Accepted Solution

by:
byundt earned 500 total points
ID: 39260733
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
ID: 39261630
Thanks
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
Do you use a spreadsheet like Microsoft's Excel?  Have you ever wanted to link out to a non excel file on your computer or network drive?  This is the way I found to do it!
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…
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.

734 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