Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
170 views
in Technique[技术] by (71.8m points)

vba - Cannot run the macro. "The macro may not be available or all macros may be disabled"

This topic has been already mentioned, however without a solution. I have a very simple Macro calling other workbooks and their macros to execute:

Sub Execute()

Workbooks.Open Filename:="C:Beta.xlsm"
Application.Run "C:Beta.xlsm!Macro"

Workbooks.Open Filename:="C:Alpha.xlsm"
Application.Run "C:Alpha.xlsm!Macro1"

ThisWorkbook.SaveChanges = False

Application.Quit

End Sub

The problem is that, now I receive an error 1004 with a message: Cannot run the macro The macro may not be available or all macros may be disabled.

PS. I have already enabled Macros and ticked the box in Trust Centre (still having error).

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

I have reinstalled the entire MS Office package. Now it works. I have no idea what caused this issue. There was no other solution to it. I have applied everything that has been mentioned in this and other posts. Thanks for ur time tho.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...