Calling VBA macro from .vbs file throws 800A03EC error

前端 未结 3 2054
失恋的感觉
失恋的感觉 2021-01-28 12:39

I\'m trying to run a VBA macro through .VBS file(File name: Check_final.vbs). Here is the code

Option Explicit

run_macro
         


        
3条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-01-28 13:26

    I think there may be something wrong with calling the run_macro statement. From the test i created in excel VBA there is an error if i try to call the sub outside of another sub

    Option Explicit
    test
    
    Sub test()
        MsgBox ("Test")
    End Sub
    

    I think you may want to

    Option Explicit
    Sub Start
        run_macro
    End Sub
    
    Sub run_macro()
        'code here
    End Sub
    

    or remove the run_macro line altogether?

提交回复
热议问题