Jump to content
Macro Express Forums

Creating variables from excel spreadsheet


mrlivingston
 Share

Recommended Posts

Hi, new user here. I searched the forums already for this subject so if it's been covered already, please accept my apologies for asking again.

 

I'm a new user of Macro Express. I'm using it to open web pages and automatically entering validation information in specific fields. I've gotten my script working for a single site and it's pulling information from a text file. Now I'd like to expand it to dynamically pull the URL from an excel spreadsheet for easy updating.

 

I have over 300 rows of codes I'd like to use as variables. My goal is to automatically generate the variables and then to use them sequentially in my macro. For example, the first row is "abc". I'd like to insert that in the URL by using something like http://website.com/%variable% which would result in the URL http://website.com/abc. I don't know how to set those variables automatically without specifying the line number, etc in the macro.

 

Once the variables are set, how to I call them in the script sequentially? I really appreciate anyone's help on this.

 

Best Regards,

 

Jason

Link to comment
Share on other sites

Here's what I would suggest. First save your Excel file to a .csv format. Then use the ASCII File Begin Process command. This runs your macro in a loop. It starts with line 1 and saves the contents to a variable such as T1. Do what you need with the variable and close with an ASCII File End Process command. This closes the loop and the macro starts over with line 2 of the .csv file and so on.

 

The Help topic for this command explains the process in more detail.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...