Jump to content

Recommended Posts

I tried using some code like this earlier and was surprised to see it fail:

With .Sheet(1)
    ; ...
    With .Range($myRange)
    ; ^-- "C:\test.au3" (105) : ==> Object referenced outside a "With" statement.:
        .Interior.ColorIndex = 44
        .Borders.ColorIndex = 0

It doesn't allow me to use the previous reference to ".Sheet(1)" inside the second With statement. Is this a bug or this intended? (Coming from VBA, it looks like a bug :))

All my code provided is Public Domain... but it may not work. ;) Use it, change it, break it, whatever you want.


My Humble Contributions:
Personal Function Documentation - A personal HelpFile for your functions
Acro.au3 UDF - Automating Acrobat Pro
ToDo Finder - Find #ToDo: lines in your scripts

Link to post
Share on other sites
18 minutes ago, seadoggie01 said:

Is this a bug or this intended?

I assume it's deliberate, see : https://www.autoitscript.com/autoit3/docs/appendix/Exitcodes.htm

0x7FFFF0A8 : Nested "With" statements are not allowed.


"In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move."

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
  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...