在Win95/Win98中用VB打開含有宏及保護密碼的EXCEL文件問題

我需要在win95/win98中用VB打開含有宏及保護的EXCEL文件,
我現在用的代碼如下:

TaskId = Shell("c:\office\office\excel.exe d:\abc.xls", vbNormalFocus)
AppActivate TaskId
WaitFor 2
sendkeys "e" '開啟宏
SendKeys "abcd", True '輸入密碼
SendKeys "{enter}", True
SendKeys "%y", True '以只讀打開

這樣在打開EXCEL時會出現Excel的logo,經常會使得開啟宏的對話框得不到焦點而不能自動打開指定的文件。

現在向各位大哥尋求解決方法,能不能在打開EXCEL文件時不要出現Excel的logo。
[441 byte] By [fangchuanmao-小虎] at [2007-12-16]
# 1
在引用中加入Microsoft Excel object Library .
使用下列语句将Excel文件打开
Set Xl = CreateObject("Excel.Application")
xl.workbooks.Open FileName, UpdateLinks, ReadOnly, Format, Password, WriteResPassword, IgnoreReadOnlyRecommended, Origin, Delimiter, Editable, Notify, Converter, AddToMRU
sxfwang at 2007-10-23 > top of Msdn China Tech,其他开发语言,Office开发/VBA...
# 2
請問sxfwang大哥,為什麼在使用office97的時候,打開EXCEL文件時,在文件中的宏不會運行,能不能選擇控制讓宏運行或不運行,謝謝!
fangchuanmao-小虎 at 2007-10-23 > top of Msdn China Tech,其他开发语言,Office开发/VBA...
# 3
如果正在打开的工作簿包含 Auto_Open 宏,则若在 Visual Basic 中打开该工作簿这些宏将不执行。如果要执行 Auto_Open 宏,必须使用RunAutoMacros 方法。
xlApp.workbooks("abc.xls").RunAutoMacros 1
sxfwang at 2007-10-23 > top of Msdn China Tech,其他开发语言,Office开发/VBA...