Jump to content
Sign in to follow this  
SRAutomater

Importing a VB script into Excel.

Recommended Posts

SRAutomater

Hi,

I am using autoit to pull together some data and put it in an excel spreed sheet. The data is put into multiple worksheets within a single workbook. If you right click on one of the worksheets name, and then select "view code", you can add custom code for that worksheet. Right now I am just using send()'s to open up the VB editor and type in the entire script. This is slow, and I would like to put a script into each worksheet. It seems like there should be a way to create a string with my script and just set it equal to something... like $excelobject.Worksheets("name").Script = $scriptstring. I can't find anything like it in the MS Office object reference. Does anyone know if this is possible?

Share this post


Link to post
Share on other sites
SRAutomater

Well, I don't know if this is possible or not, but I was able to accomplish the same thing by using AutoIt's COM support and implementing the VBA logic in AutoIt.

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  

×