Solved

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

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

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

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

Workbook link problems after copying tabs to a new workbook? David Miller (dlmille) Intro Have you either copied sheets to a new workbook, and after having saved and opened that workbook, you find that there are links back to the original sou…
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.

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