Embedding AHK Functions in an Excel Add-in??

Get help with using AutoHotkey and its commands and hotkeys
shipaddicted
Posts: 23
Joined: 15 Jul 2016, 19:57

Embedding AHK Functions in an Excel Add-in??

02 Oct 2018, 22:08

Hi ... first off, I have been using vba and ahk for my own purposes for a couple of years now, but now I've been asked to share my stuff with my coworkers. I am happy to share my stuff (who doesn't like to brag??) 'm having a hard time programming what I do and packaging it all up so someone who is a "basic computer" user can install it and use it with as little fuss as possible.

The majority of my work is in excel but I do frequently download files from the internet, which I personally use ahk to automate because it's frankly much easier than vba for me. I have an excel add-in in progress that's in its infant stages right now -- and I can do pretty much everything I need inside excel with vba no problem. It's mostly just formatting. But I keep running into roadblocks with using vba to control Internet Explorer. The daily files that we use are on a pretty secure site, so the controls are hard for me to manipulate. I only know a smidge of javascript or HTML. I have spent literally all day today trying to figure out how to log in to our site (which I have managed to figure out) and then navigate to the pages where the downloads are found. For some reason, it's almost impossible to figure out which controls will actually "hit" the files I need, so I haven't had much luck on that part.

I keep thinking I could use ahk SO EASILY to do all of this, but the thought of asking everyone to install this AND an excel add-in (and resetting trust settings, using references, etc.) seems like a very big ask for a lot of people who really know next to nothing about how computers and software work, even with step-by-step instructions with screenshots.

A best case scenario for me would be to be able to make a "super add-in" for Excel where I could embed some ahk inside of it so no one really knows it's there -- it just WORKS.

Is this even possible? If yes, how difficult is it? (On a scale of 1-10, I'd say I'm about at a 4 in skills.) I started trying to google around for it, but then thought I would probably be foolish if I spent hours doing research only to find out it'll take 10x more work than I've got on my plate right now.

Sorry for the lack of brevity. I'm a little verbose in written form. :/

Thanks for sharing your thoughts.
tmplinshi
Posts: 1480
Joined: 01 Oct 2013, 14:57

Re: Embedding AHK Functions in an Excel Add-in??

03 Oct 2018, 03:18

Instead of a Excel Add-in, maybe you could..
  • Make a separate GUI window, with some buttons in it. When buttons clicked, it connects to the active excel window by ComObjActive("Excel.Application"), then do the stuffs you want to do.
  • Use hotkeys.
  • Embed MS Office document in GUI
  • Create a GUI window, let users choose the excel file, then click a "Start" button to starting to manipulate the excel file.
For the "log in and downloading", you can use WinHttp.WinHttpRequest.5.1 COM object, which is more stable and faster than controlling the IE browser.
shipaddicted
Posts: 23
Joined: 15 Jul 2016, 19:57

Re: Embedding AHK Functions in an Excel Add-in??

03 Oct 2018, 12:14

[quote="tmplinshi"]Instead of a Excel Add-in, maybe you could..
  • Make a separate GUI window, with some buttons in it. When buttons clicked, it connects to the active excel window by ComObjActive("Excel.Application"), then do the stuffs you want to do.
  • Use hotkeys.
  • Embed MS Office document in GUI
  • Create a GUI window, let users choose the excel file, then click a "Start" button to starting to manipulate the excel file.

Thanks for the suggestions! I actually did start with a GUI in ahk about a week or so ago, but as I was researching something I wanted to do, I saw a couple of posts (not here) that suggested an add-in was the way to go. So I went that route -- but when I started running into trouble with controlling Internet Explorer, I started rethinking my strategy. (I also feel a little rushed cos my boss is asking me daily what kind of progress I've made and when I'll be able to deploy it out to everyone!) I feel so indecisive ... :facepalm:

Off to do more research ... I'll definitely be looking into the WinHttp suggestion. ANYTHING to make that mess easier!
dragoelanie
Posts: 1
Joined: 09 Oct 2018, 02:23

Re: Embedding AHK Functions in an Excel Add-in??

09 Oct 2018, 02:45

Get an Excel file to append new values to the next new downward empty cell in column A, whenever the hotkeys "Alt + E" is triggered. Apart from excel if the problem seems to be in creating MS office related document then know additional step on how to set up Microsoft Office 365 Support follow the link https://www.msofficetechnicalsupportnum ... ne-number/

Return to “Ask For Help”

Who is online

Users browsing this forum: Bing [Bot], Chunjee, Google [Bot], Odlanir, serg, Sid4G and 202 guests