Jump to content

Recommended Posts

Posted (edited)

How do I properly convert this to Autoit? This is a VBA macro that I recorded in Excel.

 ActiveSheet.Outline.ShowLevels RowLevels:=2

I need this to close my subtotal once it is finished. 

any help will be greatly appreciated. 

Edited by nooneclose
Posted

@JLogan3o13 Here is a section of my code where I do the subtotal and where I need it to collapse. I want to collapse the row level 2 after the subtotal with actual code instead of mouse clicks.

 

Sleep(1000)
MsgBox($MB_ICONINFORMATION, "WO_to_FTE_Bot", "Subtotal started")
Sleep(1000)

Const $xlSum = -4157
Global $sub_Array[1] = [7]
$oRange = $OpenWorkbook.Activesheet.Range("A1:N" & $IndexRows)
$oRange.Subtotal(2, $xlSum, $sub_Array, True, False, True)

;Sleep(3000)
;MouseClick("primary", 1107, 673, 1, 10)           ;clicks on/in th excel file to ativate it just in case
;Sleep(1000)
;MouseClick("primary", 38, 213, 2, 10)             ;Collaspes the subtotal

$OpenWorkbook.ActiveSheet.ShowLevels.RowLevels=2   ;here is where i want to actually close the row level 2 by not using mouse clicks.

Sleep(1500)
MsgBox($MB_ICONINFORMATION, "WO_to_FTE_Bot", "Subtotal Finished!")

 

Posted

My UDFs and Tutorials:

  Reveal hidden contents

 

Posted

@water Thank you very much it works perfectly! My program is 99% done. Any last hints on a way to force excel to maximize once it is opened that is excel 2010 friendly? I already have code that does it and for my excel 2016 it works fine but my co-worker who has excel 2010 it does not. 

Posted

$oExcel.Window.WindowState = -4137

My UDFs and Tutorials:

  Reveal hidden contents

 

Posted

"unbreakable" :huh:
2 minutes after the first DAU (dumbest assumable user) has laid his hand on your script it will be broken. Or even faster ;)
That's what happens to me all the time :)

My UDFs and Tutorials:

  Reveal hidden contents

 

Posted

Oh, I too love this moment when something works as I did design it :dance:
Unfortunately most of the time I have to lower my expectations and love what I get ;)

My UDFs and Tutorials:

  Reveal hidden contents

 

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
×
×
  • Create New...