Solved

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

Posted on 2013-06-19
2
492 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 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

Convert between Excel file formats (.XLS, .XLSX, .XLSM) with/without macro option David Miller (dlmille) Intro Over this past Fall, I've had the opportunity to see several similar requests and have developed a couple related solutions associateā€¦
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that undeā€¦
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.

828 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