打开工作表方法失败

时间:2016-11-23 08:53:28

标签: excel vba excel-vba vbscript

我不明白为什么我的VBScript中存在此错误:

'Déclaration des variables
Dim objExcel, objWorkbook, CurrAddin
'Création des Objets
Set objExcel = CreateObject("Excel.Application")
objExcel.Visible = True

For Each CurrAddin In objExcel.AddIns
    If CurrAddin.Installed Then
        CurrAddin.Installed = False
        CurrAddin.Installed = True
    End If
Next CurrAddin

Set objWorkbook = objExcel.Workbooks.Open("C:\rd\python_scripts\private_bank_mini3.xlsx")
'Set objWorkbook = objExcel.Workbooks.Open("C:\rd\python_scripts\Test.xlsx")

'Pause de 10 secondes
WScript.Sleep 10000
'Pause de 8 heures
'WScript.Sleep 28800000

'Enregistrement
objExcel.EnableEvents = False
objWorkbook.Close False
objExcel.EnableEvents = True

'Fermeture de Excel
'objExcel.Quit

'Désallocation mémoire 
Set objExcel = Nothing
Set objWorkbook = Nothing

'Fermeture du Script
WScript.Quit

请在下面找到我的错误消息:

Error message1

我的脚本使用文件“Test.xlsx”但不使用“private_bank_mini3.xlsx”,它们之间的区别在于第二个文件打开时加载项的收费。

你有想法管理吗?

0 个答案:

没有答案