Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 194
  • Last Modified:

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

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
tradinfo
Asked:
tradinfo
  • 2
1 Solution
 
arikkaCommented:
C++ or VB ?
0
 
gelbertCommented:
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
 
gelbertCommented:
Artical "HOWTO: Use MFC to Automate Excel & Create/Format a New Workbook"
ID: Q179706 covers font settings

0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now