Jump to content

Excel issue with Range.Value


Go to solution Solved by Juvigy,

Recommended Posts

 Hi Guys,

I have a strange issue - maybe i miss something.

This works in excel VBA:  Range("A252:A255").Value = "test"

This doesnt work from AutoIt : $oExcel.Application.ActiveWorkbook.Activesheet.Range("A252:A255").Value = "test"

What am i doing wrong? i dont get any errors - i do have an error handler to check for those, nothing pops up.

Turned out i had completely different issue - the above works from Autoit, it didnt work few times due to a bug - after restart of excel it works.

What i try to do is implement something like:

$oExcel.Application.ActiveWorkbook.Activesheet.Range("A252:A255").Formula = '=O&row()/AE&row()/AF&row()' 

Which produces in excel "=@O&ROW()/@AE&ROW()/@AF&ROW()" which doesn't evaluate and gives an excel formula error.

Edited by Juvigy
wrong issue
Link to comment
Share on other sites

  • Solution

Managed to implement this with:

$oExcel.Application.ActiveWorkbook.Activesheet.Range("A252:A255").FormulaR1C1 = '=INDIRECT("O"&ROW())/INDIRECT("AE"&ROW())/INDIRECT("AF"&ROW())'

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