AutoHotkey and Excel - AutoHotkey Tutorial #10

preview_player
Показать описание
This video tutorial shows, how to automate Excel with AutoHotkey. It shows how to open an Excel sheet, how work with data and variables and how to save the Excel sheet again. All done by a simple AutoHotkey script.

You could also watch:

0:05 Create our Excel ahk script in action
Our script will be Hotkey driven. We are creating a handle to a new Excel instance. We will set our Excel instance as visible, because Microsoft sets is as invisible per default. Furthermore we add a new workbook.

1:48 Open a specific Excel sheet
Instead of open a new Excel instance, we can open a saved Excel sheet instead with AutoHotkey.

2:46 Variable for our path
Instead of hard-coding our path, we can create a variable instead.

3:53 Let the user specify the Excel file to open
We use FileSelectFile to let the ahk user specify, which sheet to open.

5:10 Targeting our Excel instance
Using the AutoHotkey ComObjActive to target an open Excel sheet. We chose a specific cell (range) to write something in. Again we can use a variable instead of hard-coding.

7:35 Looping through an Excel column
Use a while loop to loop through our range.

11:10 Copy cells
We can use the ahk property 'Copy' to copy Excel cells.

11:54 Save an Excel sheet with AutoHotkey
We can either save our Excel sheet with an overwrite or save to a new path.

Connect with me:

#autohotkey #ahk #scripting
Рекомендации по теме
Комментарии
Автор

Hi, Andres, Thanks for this video. Seems very simple explanation and every thing is working! Like always you cover almost everything in detail and very clearly.

I have a question: while we looping though some values how to tell AHK thatI want to insert data in the new line. Loop though D column, find the last value and write/add/paste new value on the new line? In your example 7:58 I want to paste new value only in cell D6.

rimantasdanilevicius
Автор

Andres thank you so much .. I was wondering whether we can copy a range of cells to another workbook if the range is pre typed into another workbook

GeorgeFromCy
Автор

Hello Anders, In UiPath academy there is an example in EXCEL AND DATA TABLES - Practice 3(Calculating percentages of expenses). Can you please explain that!! Thank you

kranthireddy
Автор

hi.great video. is there any way to make a digital signatur and save the sheet as an pdf via AHK?

UweKasner
Автор

Where can I find the AHK syntax to work with Excel? I mean like the documentation. Nice video BTW

apocalypticbean
Автор

I am getting an error when I try to replicate the code "Error: 0x800401F3 - Invalid class string".
Do you have any idea about this how can I fix it?

krishnagajera
Автор

I've got an 0x80010001 Error, saying that the call/request was rejected by the target.
And also adds that specifically the Ex.Range...'s 'Range' rejected it

antoniong
Автор

I don't have any AutoHotKey script in my "New" menu

jasoncupak
Автор

Xpath XDOM path we need tutorial about that in automation anywhere

meenaxavier
Автор

This is Excel only, right? It doesn't work for Google Sheets in a browser?

BoredErica
Автор

i need a hot key to fill in a cell yellow

fluffyhoneytina
Автор

Cant see anything, this is with a friggen 55 inch monitor. Cant get the code to work very frustrating

DeepThinker
Автор

Looks like this is a repeat from an earlier video of yours?

shonilcha
Автор

hi sir can you help make my own ahk script in the game i play... where can i contact you

laigrimmie