Solved

How to send formatted string to Excel via automation???

Posted on 2000-04-06
3
183 Views
Last Modified: 2012-05-04
Hi all,
Do you know how to easily exporting a formatted string to a cell in Excel97 via OLE?

By formatted string I mean:
- specified the Font used for the string: name, size, bold & italic
- color of the string (e.g. red, yellow, etc...)
E.g: sending to a specific cell of Excel the string "This is a test",
with font "Comics", Size 16, Bold, and in red color ?

TIA
David.

0
Comment
Question by:tradinfo
  • 2
3 Comments
 
LVL 2

Expert Comment

by:arikka
ID: 2690735
C++ or VB ?
0
 
LVL 8

Expert Comment

by:gelbert
ID: 2690811
You will have to do it following way:
1. Get IDispatch of Excel to request latter interface which allows you to modify specific cell
2. Set text
3. Set font

See in MSDN "HOWTO: Automate Linked and Embedded ActiveX Documents"
ID: Q193039

This artical shows how to do it.
0
 
LVL 8

Accepted Solution

by:
gelbert earned 50 total points
ID: 2690829
Artical "HOWTO: Use MFC to Automate Excel & Create/Format a New Workbook"
ID: Q179706 covers font settings

0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

When writing generic code, using template meta-programming techniques, it is sometimes useful to know if a type is convertible to another type. A good example of when this might be is if you are writing diagnostic instrumentation for code to generat…
  Included as part of the C++ Standard Template Library (STL) is a collection of generic containers. Each of these containers serves a different purpose and has different pros and cons. It is often difficult to decide which container to use and …
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

864 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

24 Experts available now in Live!

Get 1:1 Help Now