Opening an Excel workbook with ActiveX controls initialization popup Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Playnot
Posts: 2
Joined: 14 Apr 2021, 09:18

Opening an Excel workbook with ActiveX controls initialization popup

14 Apr 2021, 09:43

Hey folks, I wasn't able to find any info on this, so I'lll get right to it.

I'm trying to copy a table from an existing Excel workbook with formatting and send it as an email. However I'm running into an issue, because the table shows the ActiveX controls initialization popup and I'm unable to select any cells:
image.png
image.png (9.29 KiB) Viewed 163 times
Can anyone share some wisdom on how I can open the workbook AND accept the warning, as I'm not very familiar with the COM stuff? So far I've got just the basics, cause I want to clear this issue first:

Code: Select all

#s::
Path := "my path here" ; Path to table
xl := ComObjCreate("Excel.Application") ; Opens Excel
xl.visible := true
xl.Workbooks.open(Path) ; Opens the table
xl.Range("B2","R56").Copy ; copy the required table
MsgBox, % Clipboard ; to check what has been copied
I was going to try with just finding out the button ID with window spy and use ControlClick or something, but I'm not sure how well those two interact.

I'd really appreciate any help or knowledge thrown at me.
Thanks in advance.
Last edited by Playnot on 14 Apr 2021, 10:30, edited 1 time in total.
Playnot
Posts: 2
Joined: 14 Apr 2021, 09:18

Re: Opening an Excel workbook with ActiveX controls initialization popup

14 Apr 2021, 09:54

That seems like it might work, however as I'm using a corporate computer, I don't have access to those options. It would also mean that if I gave that script to a colleague they'll have to use the same options. I was wondering if there's a way to do it within the script itself?
BoBo
Posts: 6564
Joined: 13 May 2014, 17:15

Re: Opening an Excel workbook with ActiveX controls initialization popup  Topic is solved

14 Apr 2021, 10:03

Kinda dangerous thing - because it’s a generic warning you can‘t use a separate script using a SetTimer-routine that would click away that alert each and every time for security reasons. So a simple WinWaitActive > ControlClick/... that is only related to this event should do the trick. HTH

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Decar, doodles333, Google [Bot], mikeyww, Tupper and 228 guests