Solved

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

Posted on 2000-04-06
3
182 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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

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…
In days of old, returning something by value from a function in C++ was necessarily avoided because it would, invariably, involve one or even two copies of the object being created and potentially costly calls to a copy-constructor and destructor. A…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

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

12 Experts available now in Live!

Get 1:1 Help Now