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
Solved

VSTO 2005 Storing format details as strings

Posted on 2006-11-20
3
193 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

Article by: jpaulino
XML Literals are a great way to handle XML files and the community doesn’t use it as much as it should.  An XML Literal is like a String (http://msdn.microsoft.com/en-us/library/system.string.aspx) Literal, only instead of starting and ending with w…
It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

856 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