Improve company productivity with a Business Account.Sign Up

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

VSTO 2005 Storing format details as strings

Hi

How do you store the formatting details of a
formatted cell in a  managed spreadsheet?

eg the I need the color to be stored as a string variable for later use

0
Murray Brown
Asked:
Murray Brown
  • 2
1 Solution
 
newyuppieCommented:
does this work?

' Work with the current active cell.
    Dim currentCell As Excel.Range = Me.Application.ActiveCell

'create a style on thw workbook
Dim style As Excel.Style = Globals.ThisWorkbook.Styles.Add("NewStyle")
'assign the style of cell to the style created
style = currentCell.Style

now you can reference the "style" on any other cell.
from another part in code
' Work with the current active cell.
    Dim currentCell As Excel.Range = Me.Application.ActiveCell
currentCell.Style = "NewStyle"


0
 
Murray BrownMicrosoft Cloud Azure/Excel Solution DeveloperAuthor Commented:
Worked well. Thanks very much
0
 
newyuppieCommented:
great. thank for the points!
NY
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: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

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.

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