CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2010
    Posts
    1

    Automating Excel 2007, using Visual Studio 6 (VC++)

    Hi!

    I have a program that gathers some data for testing equipment then spits it out into an excel sheet. It was working great until we upgraded from 2003 to excel 2007. Now the program just hangs when I attempt to export the data:

    This is the code. I need help making this work with excel12 (2007). Thanks if anyone has a tip! I am using Visual C++ 6, everything I could find online is for VC++ 2005 or .net and I couldn't get it to translate =(


    #include "excel8.h"

    ....


    _Application app; // Excel 8 Application object
    _Workbook book; // Workbook object
    _Worksheet sheet; // Worksheet object
    COleSafeArray safeData; // SAFEARRAY
    COleSafeArray safeInfo; // SAFEARRAY

    ....

    if (!app.CreateDispatch("Excel.Application"))
    {
    AfxMessageBox("Could not start Excel");
    }
    else
    {
    .....

  2. #2
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,396

    Re: Automating Excel 2007, using Visual Studio 6 (VC++)

    Search this Forum for "excel8.h" or "excel.h" I guess you'll find some useful discussions there.
    Victor Nijegorodov

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured