Click here to Skip to main content
15,899,314 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: CSocket Pin
MailtoGops26-Aug-05 3:05
MailtoGops26-Aug-05 3:05 
GeneralRe: CSocket Pin
sunit526-Aug-05 3:41
sunit526-Aug-05 3:41 
GeneralRe: CSocket Pin
MailtoGops26-Aug-05 3:52
MailtoGops26-Aug-05 3:52 
GeneralRe: CSocket Pin
sunit526-Aug-05 4:17
sunit526-Aug-05 4:17 
AnswerRe: CSocket Pin
Moak (not logged in)27-Aug-05 22:27
sussMoak (not logged in)27-Aug-05 22:27 
QuestionExcel Automation Pin
Identity Undisclosed25-Aug-05 21:52
Identity Undisclosed25-Aug-05 21:52 
AnswerRe: Excel Automation Pin
Steve S25-Aug-05 23:44
Steve S25-Aug-05 23:44 
AnswerRe: Excel Automation Pin
Rage26-Aug-05 0:33
professionalRage26-Aug-05 0:33 
Search MSDN for
<br />
HOWTO: Use MFC to Automate Excel 97 and Navigate Worksheets<br />
Article ID: Q178782  


A snapshot:

_Application app;  // app is an _Application object.
      _Workbook book;
      _Worksheet sheet;
      Workbooks books;
      Worksheets sheets;
      Range range;
      char buf[1024];
      LPDISPATCH lpDisp; // IDispatch *; pointer reused many times.
      long count; // Count of the number of worksheets.
      int i;



      // Common OLE variants. These are easy variants to use for
      // calling arguments.
      COleVariant
                 covTrue((short)TRUE),
                 covFalse((short)FALSE),
                 covOptional((long)DISP_E_PARAMNOTFOUND, VT_ERROR);

      // Start Excel and get Application object.
      if(!app.CreateDispatch("Excel.Application"))
      {
       AfxMessageBox("Couldn't CreateDispatch on Excel");
       return;
      }

      // Set visible.
      app.SetVisible(TRUE);

      // Get Workbooks collection.
      lpDisp = app.GetWorkbooks();  // Get an IDispatch pointer
      ASSERT(lpDisp);               // or fail.
      books.AttachDispatch( lpDisp );  // Attach the IDispatch pointer
                                       // to the books object.

      // Open a workbook.
      lpDisp = books.Open("C:\\My Docs\\Test",
                     covOptional, covOptional, covOptional, covOptional,
                     covOptional, covOptional, covOptional, covOptional,
                     covOptional, covOptional, covOptional, covOptional
                     );
      ASSERT(lpDisp);  // It worked!



~RaGE();
QuestionHow to Hide WindowName and Rectangle From Taskbar Pin
Amarelia25-Aug-05 20:55
Amarelia25-Aug-05 20:55 
AnswerRe: How to Hide WindowName and Rectangle From Taskbar Pin
dharani25-Aug-05 22:26
dharani25-Aug-05 22:26 
GeneralRe: How to Hide WindowName and Rectangle From Taskbar Pin
Amarelia26-Aug-05 2:57
Amarelia26-Aug-05 2:57 
QuestionCan you tell me how can I control speeds of IIS. Pin
10244225-Aug-05 20:09
10244225-Aug-05 20:09 
QuestionHiding characters in text file Pin
m_shezy25-Aug-05 19:35
m_shezy25-Aug-05 19:35 
QuestionAbout CMonthCalCtrl : Plz Help. Pin
parims25-Aug-05 18:48
parims25-Aug-05 18:48 
QuestionHelp Really need!! Pin
cue_ball25-Aug-05 17:14
cue_ball25-Aug-05 17:14 
AnswerRe: Help Really need!! Pin
dharani25-Aug-05 17:33
dharani25-Aug-05 17:33 
AnswerRe: Help Really need!! Pin
Weiye Chen25-Aug-05 17:58
Weiye Chen25-Aug-05 17:58 
GeneralRe: Help Really need!! Pin
cue_ball25-Aug-05 18:04
cue_ball25-Aug-05 18:04 
GeneralRe: Help Really need!! Pin
Weiye Chen25-Aug-05 18:15
Weiye Chen25-Aug-05 18:15 
GeneralRe: Help Really need!! Pin
cue_ball25-Aug-05 18:36
cue_ball25-Aug-05 18:36 
GeneralRe: Help Really need!! Pin
Weiye Chen25-Aug-05 19:12
Weiye Chen25-Aug-05 19:12 
GeneralRe: Help Really need!! Pin
cue_ball25-Aug-05 19:28
cue_ball25-Aug-05 19:28 
GeneralRe: Help Really need!! Pin
Weiye Chen25-Aug-05 20:10
Weiye Chen25-Aug-05 20:10 
GeneralRe: Help Really need!! Pin
cue_ball25-Aug-05 22:45
cue_ball25-Aug-05 22:45 
Questionhow to change the content in chtmview? Pin
liuyue25-Aug-05 16:01
liuyue25-Aug-05 16:01 

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.