I have been using AHK with Excel COM for a while already, Excel 2016 for some reason now Excel 2016 says 365 maybe the newest version is bound into 365, I have no idea in regards to this. But for some reason these 2 weeks my uncle has been reporting about excel not opening fast and he was right!
Symptoms:
Excel taking 10-15 sec to open a new book (book1)
If I immediately try to open excel again within 10-15 sec excel opens book2 then book1, no need to wait book1 to open first. weird
I quit my ahk script and excel opens normally again. (maybe I did some change to my script? I doubt it, haven't touched it since a while.
There was once I tried to open excel and book9 opened always instead of book1 everytime.
Script used:
excel_filename := "fer.client_searcher.xlsm - Excel" ;excel searcher name
IfWinExist, %excel_filename%
{
WinActivate, %excel_filename%
WinWaitActive, %excel_filename%,,2
newmatch_or_Search := newmatch
gosub, excel_handle_macro_paste
return
} else {
IfWinNotExist, %excel_filename%
file := "C:\Users\" A_UserName "\Google Drive\AHK\fer.client_searcher.xlsm"
Run, %file%
gosub, during_after_wait
newmatch_or_Search := newmatch
gosub, excel_handle_macro_paste
return
} } else {
excel_filename := "fer.searcher.xlsm - Excel" ;excel searcher name
IfWinExist, %excel_filename%
{
WinActivate, %excel_filename%
WinWaitActive, %excel_filename%,,2
newmatch_or_Search := Target
gosub, excel_handle_macro_paste
return
} else {
IfWinNotExist, %excel_filename%
file := "C:\Users\" A_UserName "\Google Drive\AHK\fer.searcher.xlsm"
Run, %file%
gosub, during_after_wait
newmatch_or_Search := Target
gosub, excel_handle_macro_paste
} } return
excel_handle_macro_paste:
Xl := Excel_Get() ;creates a handle to your currently active excel sheet
xlsfile := xl.ActiveWorkbook.name ;retrieves the name of the active workbook
xl.Run(xlsfile "!Box") ;run excel macro
Clipboard =
Clipboard := newmatch_or_search ;search for submit data or newmatch for extracted data from regex
ClipWait
Send, ^v{Enter}
return
during_after_wait:
WinWait, %excel_filename%
WinActivate, %excel_filename%
WinWaitActive, %excel_filename%,,2
return
This is just some code of the big script but this is what the main thing basically does with EXCEL COM
Xl := Excel_Get() ;creates a handle to your currently active excel sheet
xlsfile := xl.ActiveWorkbook.name ;retrieves the name of the active workbook
xl.Run(xlsfile "!Box") ;run excel macro+
Ok so this has worked for a long long time. Windows 10, Office 2016. Both have been updated but still remain on same versions. What could be the cause for this? I was even about to reinstall Windows 10!!! I'm glad I noticed my script was causing this problem.
PS: btw The only problem is Excel taking 10 seconds to open something, the rest ahk and excel works every time.
- Home Board index AutoHotkey (v1.1 and older) Ask for Help (v1)
- Search
-
- It is currently 03 Jun 2024, 16:21
- All times are UTC-05:00
I need help with AHK + Excel COM = Excel Opens veeeeery slowly.
Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Jump to
- AutoHotkey Foundation
- About This Community
- Forum Issues
- AutoHotkey (v2, current version)
- Ask for Help (v2)
- Gaming
- Scripts and Functions (v2)
- Gaming
- Tutorials (v2)
- Tips and Tricks
- Wish List
- Suggestions on Documentation Improvements
- Bug Reports
- AutoHotkey Development
- AutoHotkey_H
- Ask for Help
- Development
- Editors
- Adventure IDE
- Old Topics
- AHK Studio
- Notepad++
- Pulovers Macro Creator
- SciTE4AutoHotkey
- Visual Studio Code
- Announcements
- General Discussion
- AutoHotkey (v1.1 and older)
- Ask for Help (v1)
- Gaming Help (v1)
- Scripts and Functions (v1)
- Gaming Scripts (v1)
- Tutorials (v1)
- Tips and Tricks (v1)
- General
- Other Utilities & Resources
- Other Programming Languages
- C/C++
- ASM
- C#
- KeySharp
- Off-topic Discussion
- RPA
- Other languages
- Looking for Volunteers in other languages
- Deutsch (German)
- Ich brauche Hilfe
- Spiele
- Skripte und Funktionen
- Tutorials
- Tooltime
- Allgemeines
- 中文 (Chinese)
- 请求帮助
- 脚本函数
- 教程资料
- 相关工具
- 其他
- Español (Spanish)
- Pedir Ayuda
- Automatización de Juegos
- Scripts y Funciones
- Tutoriales
- Otras Utilidades y Recursos
- General
- Русский (Russian)
- Помощь
- Скрипты для Игр
- Скрипты и библиотеки
- Статьи и руководства
- Прочие ресурсы и ПО.
- Свободное общение
- Français (French)
- J'ai besoin d'aide
- Scripts et Fonctions
- Tutoriels
- Autres Utilitaires et Ressources
- Hors Sujet
- Português (Portuguese)
- Ajuda e Suporte Geral
- Scripts e Funções
- Tutoriais
- Outras Ferramentas e Recursos
- Outros Assuntos
- 한국어 (Korean)