Click here to Skip to main content
15,927,212 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Anyone use Hoard? Pin
User 988525-Apr-03 10:06
User 988525-Apr-03 10:06 
GeneralLinker taking forever... Pin
Nitron25-Apr-03 9:08
Nitron25-Apr-03 9:08 
GeneralRe: Linker taking forever... Pin
Anna-Jayne Metcalfe25-Apr-03 9:48
Anna-Jayne Metcalfe25-Apr-03 9:48 
GeneralRe: Linker taking forever... Pin
Nitron25-Apr-03 10:49
Nitron25-Apr-03 10:49 
GeneralRe: Linker taking forever... Pin
Anders Molin25-Apr-03 11:21
professionalAnders Molin25-Apr-03 11:21 
GeneralWriting into an Excelfile Pin
Heiko200325-Apr-03 8:55
sussHeiko200325-Apr-03 8:55 
GeneralExcel Pin
Heiko200325-Apr-03 8:54
sussHeiko200325-Apr-03 8:54 
GeneralRe: Excel Pin
David Crow25-Apr-03 9:02
David Crow25-Apr-03 9:02 
Search MSDN for examples of Excel automation. Here's one I came up with:

_Application    app;
Workbooks       books;
_Workbook       book;
Worksheets      sheets;
_Worksheet      sheet;
Range           range;
COleVariant     vtOptional((long) DISP_E_PARAMNOTFOUND, VT_ERROR),
                vtTrue((short) TRUE),
                vtFalse((short) FALSE);
CString         strText;


if (app.CreateDispatch("Excel.Application") == TRUE)
{
    app.SetVisible(TRUE);

    books = app.GetWorkbooks();

    book = books.Add(vtOptional);

    sheets = book.GetSheets();

    sheet = sheets.GetItem(COleVariant((short) 1));

    range = sheet.GetRange(COleVariant("A1"), COleVariant("A1"));
    m_ebCellA1.GetWindowText(strText);
    range.SetValue(COleVariant(strText));

    range = sheet.GetRange(COleVariant("A2"), COleVariant("A2"));
    m_ebCellA2.GetWindowText(strText);
    range.SetValue(COleVariant(strText));

    range = sheet.GetRange(COleVariant("A4"), COleVariant("A4"));
    range.SetFormula(COleVariant("=A1 + A2"));
}

GeneralRe: Excel Pin
Heiko200325-Apr-03 9:30
sussHeiko200325-Apr-03 9:30 
GeneralRe: Excel Pin
David Crow25-Apr-03 9:38
David Crow25-Apr-03 9:38 
GeneralRe: Excel Pin
Heiko200325-Apr-03 10:26
sussHeiko200325-Apr-03 10:26 
GeneralRe: Excel Pin
David Crow25-Apr-03 10:29
David Crow25-Apr-03 10:29 
GeneralRe: Excel Pin
Heiko200325-Apr-03 10:37
sussHeiko200325-Apr-03 10:37 
GeneralRe: Excel Pin
David Crow25-Apr-03 10:42
David Crow25-Apr-03 10:42 
GeneralRe: Excel Pin
Heiko200326-Apr-03 8:26
sussHeiko200326-Apr-03 8:26 
Questionhow to make software evaluation? Pin
_ra25-Apr-03 8:42
_ra25-Apr-03 8:42 
AnswerRe: how to make software evaluation? Pin
Maximilien25-Apr-03 9:08
Maximilien25-Apr-03 9:08 
AnswerRe: how to make software evaluation? Pin
Gary Kirkham25-Apr-03 10:20
Gary Kirkham25-Apr-03 10:20 
Generalmulti-thread question Pin
will138325-Apr-03 8:37
will138325-Apr-03 8:37 
GeneralRe: multi-thread question Pin
Martin Cook25-Apr-03 8:52
professionalMartin Cook25-Apr-03 8:52 
GeneralChangine the icon in the top left corner Pin
mcgahanfl25-Apr-03 8:28
mcgahanfl25-Apr-03 8:28 
GeneralRe: Changine the icon in the top left corner Pin
Chris Losinger25-Apr-03 8:33
professionalChris Losinger25-Apr-03 8:33 
GeneralRe: Changine the icon in the top left corner Pin
mcgahanfl25-Apr-03 11:10
mcgahanfl25-Apr-03 11:10 
GeneralRegular Expression Library for C++ Pin
User 665825-Apr-03 8:23
User 665825-Apr-03 8:23 
GeneralRe: Regular Expression Library for C++ Pin
Neville Franks25-Apr-03 12:17
Neville Franks25-Apr-03 12:17 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.