Solved

VSTO 2005 Storing format details as strings

Posted on 2006-11-20
3
196 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:Murray Brown
[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
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:Murray Brown
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: 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

This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
Article by: Kraeven
Introduction Remote Share is a simple remote sharing tool, enabling you to see, add and remove remote or local shares. The application is written in VB.NET targeting the .NET framework 2.0. The source code and the compiled programs have been in…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…

632 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