Solved

VSTO 2005 Storing format details as strings

Posted on 2006-11-20
3
184 Views
Last Modified: 2010-08-05
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
Comment
Question by:murbro
  • 2
3 Comments
 
LVL 13

Accepted Solution

by:
newyuppie earned 500 total points
ID: 17980333
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
 

Author Comment

by:murbro
ID: 17985661
Worked well. Thanks very much
0
 
LVL 13

Expert Comment

by:newyuppie
ID: 17986687
great. thank for the points!
NY
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

A while ago, I was working on a Windows Forms application and I needed a special label control with reflection (glass) effect to show some titles in a stylish way. I've always enjoyed working with graphics, but it's never too clever to re-invent …
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…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

743 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

13 Experts available now in Live!

Get 1:1 Help Now