VBScript Runtime Error : Open method of Workbooks class failed

Ringo 6 Reputation points
2021-01-08T09:10:42.993+00:00

When running VBScript, the Runtime Error appear

'Open method of Workbooks class failed'
Code : 800A03EC

the line in the vbscript where it stopped is
xlApp.Workbooks.Open(Replace(WScript.ScriptFullName, WScript.ScriptName, "") & "Testing Program.xlsm")

It happened randomly, e.g. once in a week and it did not happen every time run manually or under scheduler.

May I know if anyone can shed some lights on that ?

thanks !

Developer technologies Visual Basic for Applications
0 comments No comments
{count} vote

2 answers

Sort by: Most helpful
  1. Tom van Stiphout 1,861 Reputation points MVP Volunteer Moderator
    2021-01-09T20:50:39.91+00:00

    Is that filename a local file?
    If not, it can be that a mapped drive is (momentarily) not connected, or may even require a reboot before being connected again.
    Use an error handler, and ask the user to check if the file exists and then click Retry.

    0 comments No comments

  2. Ringo 6 Reputation points
    2021-01-20T08:57:31.237+00:00

    the VBScript file is running locally under the desktop.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.