1

I have tried to write a script to open another excel.

My code

Sub test()
filetoopen=thisworkbook.worksheet("sheet1").Range("D18")

Where is my mistake?

Thank you for your advice.

1 Answer 1

2

You can use:

Sub test()
filetoopen = ThisWorkbook.Worksheets("sheet1").Range("D18")
Workbooks.Open FileName:=filetoopen
ActiveWindow.ActivatePrevious
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.