Jump to content

How to call variable of one script to another


 Share

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:-

Script1:-

$TestInputspath=IniRead("XXXX")

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

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

Script2:-

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
Link to comment
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:

Spoiler

ALWAYS GOOD TO READ:

 

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...