0

I search answers on this site , but they do not have complete info

I have a file c: ....test.xlsm it has a subroutine test ()

sub test () 
msgbox "hello stackoverflow"
end sub

I want to write a vbscript that would

1) open c: ....test.xlsm

2) run test () subroutine

3) close c: ....test.xlsm

How can I do this ?

1 Answer 1

1

Assuming it is in a module, you would call it like so

dim eApp
set eApp = GetObject("C:\wb.xlsm")
eApp.Application.Run "wb.xlsm!test"
set eApp = nothing
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.