Jump to content
Sign in to follow this  

How to call variable of one script to another

Recommended Posts


I would like to know how to call a variable from one AutoIT script to Another. There are few questions posted in similar grounds in this forum but apparently still not getting what to be done.

My scripts are:-



Global $TestInputsWorkBook=_Excel_BookOpen($OpenExcel,$TestInputspath)

The variable '$TestInputsWorkBook' is been used in many places through out the script1.


I would like to call the same variable '$TestInputsWorkBook' here in script2 as well. So that the same variable can be used in remaining portion of script2.

For the time being, I am have kept the script1 line repeated in script2 as well but each time the excel sheet is getting opened again which is why I wanted to reuse the already declared variable from script1.

Hope my question is clear to all. 

Edited by prasadstudy

Share this post

Link to post
Share on other sites

Hi @prasadstudy, and welcome to the AutoIt forum :)

Why do you divided the _Excel* management and you would like to use a variable which point to an Excel Workbook handle?

Can you please post your code ( or a replication of it ), in order to let us understand what you don't want to repeat in your first script?

Thanks :)

Click here to see my signature:



  • I will always thank you for the time you spent for me.
    I'm here to ask, and from your response, I'd like to learn.
    By my knowledge, I can help someone else, and "that someone" could help in turn another, and so on.




Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this