vbScript opens up excel but doesn't load macro/modules?

允我心安 提交于 2019-12-02 07:05:30

I just tested your code against a dummy file I made. It worked when I placed the code inside a module and left it as public. However, when I put into a private module -> like worksheet level module, I got the error you got.

However, when I referenced the private object, the code ran through. So my answer to you is to replace

oExcel.Run "RefreshDataFromIQY"

With

oExcel.Run "[yourClassName].RefreshDataFromIQY"

Also, I placed a workbook_event in my file as well. The event triggered successfully on open, so if there is trouble with yours, it's most likely in the code inside the event.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!