Changing XL.Visible := False/True Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Trigg
Posts: 97
Joined: 07 Apr 2017, 19:43

Changing XL.Visible := False/True  Topic is solved

14 Aug 2017, 08:46

Is it possible for ComObj to show/hide using XL.Visible := False/True?

EDIT:
I figured it out. ComObjGet was causing the issue. I didn't realize I needed to change the variable for it to work. Sorry guys!

Code: Select all

Path := "C:\Users\" . A_Username . "\Desktop\Book1.xlsx"
	XL := ComObjCreate("Excel.Application")
	XL.Workbooks.Open(Path)
	XL.Visible := False
	XL2 := ComObjGet(Path)
Return

1::
If ( XL.Visible = False )
	XL.Visible := True
	
Else
	XL.Visible := False

Return

User avatar
TheDewd
Posts: 1513
Joined: 19 Dec 2013, 11:16
Location: USA

Re: Changing XL.Visible := False/True

16 Aug 2017, 16:03

Glad you figured it out. I thought I'd let you know you can use ternary to shorten your hide/show code:

Code: Select all

1::
    XL.Visible := (XL.Visible ? 0 : 1) ; Toggle
return
Trigg
Posts: 97
Joined: 07 Apr 2017, 19:43

Re: Changing XL.Visible := False/True

16 Aug 2017, 20:08

TheDewd wrote:Glad you figured it out. I thought I'd let you know you can use ternary to shorten your hide/show code:

Code: Select all

1::
    XL.Visible := (XL.Visible ? 0 : 1) ; Toggle
return
Oh wow. This helps a bunch! Thank you.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Bing [Bot] and 148 guests