Posted on 2009-10-03 22:21
S.l.e!ep.¢% 閱讀(531)
評論(0) 編輯 收藏 引用 所屬分類:
Office Automation
這篇比較全面:Office Automation Using Visual C++
? http://support.microsoft.com/kb/196776/EN-US/
這篇為具體的示例:How to use MFC to automate Excel and create and format a new workbook
http://support.microsoft.com/kb/179706/EN-US/
以下轉(zhuǎn)其他人的總結(jié):
在VC中操作Excel,?我們會用到Automation?(自動化)?技術(shù)。Automation是一種基于COM的技術(shù)。它的出現(xiàn)使得跨應(yīng)用程序的操作成為可能。下面這篇KB總結(jié)了關(guān)于學(xué)習(xí)Automation的資料:
Q152023?Locating?Resources?to?Study?Automation
http://support.microsoft.com/support/kb/articles/q152/0/23.asp
此外,我們還需要了解Excel的Object?Model。通常,我們可以在Excel中將所需的宏錄制下來,加以修改后翻譯成VC的代碼。要了解Excel的Object?Model,可以參閱MSDN關(guān)于Office開發(fā)的文章。
http://msdn.microsoft.com/library/en-us/modcore/html/deovrMicrosoftExcel2000.asp
Excel中的幫助文檔也非常有用。另外,請參閱以下KB文章。它們包含了一些例程和相關(guān)資料:
Q184663?HOWTO:?Embed?and?Automate?a?Microsoft?Excel?Worksheet?with?MFC
http://support.microsoft.com/support/kb/articles/q184/6/63.asp
Q186120?HOWTO:?Use?MFC?to?Automate?Excel?and?Fill?a?Range?with?an?Array
http://support.microsoft.com/support/kb/articles/q186/1/20.asp
Q216686?HOWTO:?Automate?Excel?From?C++?Without?Using?MFC?or?#import
http://support.microsoft.com/support/kb/articles/q216/6/86.asp
Q222101?HOWTO:?Find?and?Use?Office?Object?Model?Documentation
http://support.microsoft.com/support/kb/articles/q222/1/01.asp
Q196776?FAQ:?Office?Automation?Using?Visual?C++
http://support.microsoft.com/support/kb/articles/q196/7/76.asp