|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
原来excel的个人宏工作簿中有程序,现在在outlook中用vba 调用excel.application 打开指定的excel时,原来excel中的宏无法使用。哪位大侠知道该怎么办。
Private Sub vsoCommbandSaveAttach3_Click(ByVal Ctrl As Office.CommandBarButton, CancelDefault As Boolean)
On Error Resume Next
Dim myExcel
Dim myExcelPath As String
myExcelPath = "C:\Documents and Settings\Administrator\桌面\1.xlsx"
Dim myExcelName As String
myExcelName = "1.xlsx"
Set myExcel = CreateObject("Excel.Application")
myExcel.workbooks.Open FileName:=myExcelPath, ReadOnly:=False
myExcel.Visible = True
myExcel.EnableEvent = False
myExcel.Windows(myExcelName).Activate
End Sub
(直接打开excel,可以使用个人宏工作簿,用outlook vba调用excel.application打开,则无法使用个人宏工作簿)
|
|