在程序mfc里怎样运行excel的宏???

解决方案 »

  1.   

    你的意思应该是运行已经定义好的宏吧。
    Excel的automation没做过。word里面我通常是用MFC来模拟宏生成的VBA代码来模拟宏的行为。或者你可以用_Document类的Run来调用宏,当你打开一个文件使用Add时也可以指定宏,在word的automation中,还可以用FormField类为一个窗体域指定宏,用它的
    CString GetEntryMacro();
    void SetEntryMacro(LPCTSTR lpszNewValue);
    函数。
      

  2.   

    Results 1 - 65 of about 79 from support.microsoft.com for MFC excel macro. (0.63 seconds) How To Use MFC to Retrieve a List of Macro Names in an Office Document
    This article illustrates by example how you can create an MFC Automation ...
    to place the list of macro //names in the list box. if(sProgID.Find("EXCEL. ...
    support.microsoft.com/?kbid=274680 - Similar pages How To Add and Run a VBA Macro Using Automation from MFC
    How To Add and Run a VBA Macro Using Automation from MFC ... Click 'Macro' to
    start Excel"); AfxMessageBox("Click the EndXL button to remove Excel,\n" "Then ...
    support.microsoft.com/support/KB/Articles/Q194/9/06.asp - Similar pages