View Full Version : [HotKeyNet] Hep with hotKey Net to run Excel Macro
redree
11-30-2013, 06:09 AM
Hi guys
i was looking for something that will allow me to remotely control a PC from another one, for quite time i was using teamviewer to do that and it was pretty good, but i did not really need all these features in TMVR so i when searching i discovered Hotkey Net.
to task i need to do is from PC1 i want to run an excel macro on PC2, Hotkey really worked as wanted but now i am facing a problem, after restarting my PCs HKN stopped working, when ever i run the HotKey from PC1 the HKN in PC2 receive the command but i get bellow message
<sendwin Book1> failed: Could not find window "Book1"
<text test1> failed: no window is targeted
i tried the do the same from the local pc and i get the same message.
last thing i tried is renaming the file from Hotkey Net then i got bellow message but nothing happened, the window not brought up and macro does not run
<sendwin project> completed: Window found. Target set to 0x100C4 "project"
<key Ctrl t> completed.
he is my code
<Hotkey F11>
<sendpc local>
<sendwin Book1>
<key Ctrl w>
your help will be highly appreciated.
Khatovar
11-30-2013, 06:32 AM
after restarting my PCs HKN stopped working, when ever i run the HotKey from PC1 the HKN in PC2 receive the command but i get bellow message
<sendwin Book1> failed: Could not find window "Book1"
<text test1> failed: no window is targeted
i tried the do the same from the local pc and i get the same message.
This site is really just about mutliboxing. Documentation about HotKeyNet for other uses is still maintained on the HotKeyNet website (http://hotkeynet.com/). You can also find archived discussions on the old HotKeyNet forum (http://hotkeynet.com/phpBB3/index.php), which while no longer active, were left up as a means of further documentation.
That said, I can try to help from a very limited, multiboxer only PoV.
HotKeyNet is telling you that you don't have a window called Book1 open or running anywhere on the assigned PC. You need to assign the names of the windows before you can expect HKN to find it, which is normally done via Rename command (http://hotkeynet.com/ref/functions.html) at the start of the script.
This is especially important in situations where the window names can change. For example, I can open Notepad++, the window isn't called Notepad++, it's called "new 1 - Notepad++ [Administrator]" I open another file, the whole window is now called "new 2...etc" or I open a named file, the window now becomes "the file's path\filename - Notepad++ [Administator]" and so on.
Or in situations like we as multiboxers see, where several windows have the same name and HKN needs a way to distinguish the different windows reliably.
So we need to tell HotKeyNet to assign a standard name for any window it needs to interact with so that it knows where to find things every time. When you restarted your PCs it sounds like the window you brought up the next time around was no longer called "Book1."
I don't know if you have a rename setup in your script since you only posted a single hotkey, but that is where you'll need to start.
redree
11-30-2013, 01:53 PM
Thank you for you reply and appreciate your help
i have renamed the workbook from the HKN tool, also i included rename command in the script as bellow
<Hotkey 1>
<sendpc local>
<Renamewin Book1 project>
<sendwin Project>
<key Ctrl w>
and now i am getting this message
From this pc: <Renamewin Book1><sendwin project><key Ctrl w>
<Renamewin Book1> failed: Could not find window "project"
<sendwin project> failed: Could not find window "project"
<key Ctrl w> failed: no window is targeted
i run the HKN as administrator but nothing happened.
please accept my appology if this going to disturb you, i really need help as this is very important for my project.
Khatovar
12-01-2013, 03:38 AM
HotKeyNet still isn't finding the window. this is what a script should look like
//----------------------------------------------------------
// LAUNCH AND RENAME
//----------------------------------------------------------
<Command LaunchAndRename>
<SendPC %1%>
<Run %2%>
<RenameTargetWin %3%>
LaunchAndRename starts your programs and renames the windows via path or default window name to a standardized format. It uses arguments as variables which are found within the below Launch Hotkey.
//----------------------------------------------------------
// LAUNCH HOTKEY
//----------------------------------------------------------
<Hotkey LCtrl LAlt w>
<if WinDoesNotExist WINDOW_NAME>
<LaunchAndRename LOCAL_OR_IP "FULL_PATH_OF_WHATEVER_YOU'RE_RUNNING" WINDOW_NAME>
<endif>
<if WinDoesNotExist DIFFERENT_WINDOW>
<LaunchAndRename LOCAL_OR_IP "FULL_PATH_OF_WHATEVER_YOU'RE_RUNNING" DIFFERENT_WINDOW_NAME>
<endif>
The Launch Hotkey is the key you use to trigger the running and renaming of the programs you are looking for HotKeyNet to control.
Argument 1 - SendPC (http://hotkeynet.com/ref/sendpc.html). Choose which computer the command is sent to. If you are controlling a window on the main PC, then use local. If you are controlling something on the secondary PC, you need to use the IP.
Argument 2 - The Path Name of the program or file you need to run. You keep calling it "Book1". If that is the name of a file on your PC, you need to put in the entire path name here, so that should look something like "C:\Users\UserName\Where\Ever\Book1.txt"
Argument 3 - The Window's "nickname". This is the part that renames the window from it's default {like the "the file's path\filename - Notepad++ [Administator]" that I mentioned in my first response} to a short, simple and unique name that HKN can consistently find. This would be "Book1" or "project" or whatever you like. It must be unique from any other name you would assign to any other window.
//----------------------------------------------------------
// DEFINE LABELS
//----------------------------------------------------------
<Label w1 Local SendWinM Book1>
<Label w2 IP_ADDRESS SendWinM Book2>
Finally you have your labels (http://hotkeynet.com/ref/label.html). These are aliases for both the window name and location. These are what you will use in the hotkeys themselves. In this instance, anything that uses the label "w1" will send commands to the window on your main PC {local} that is called "Book1". Anything using "w2" will send commands to the window on your remote PC {IP Address} that is called "Book2."
You must run this set of subroutines every time so it can launch and rename the windows properly. This is done by pressing LCtrl LAlt W with HotKeyNet running and the script loaded. Once the windows are defined and named, then keys will know where to go.
Hotkeys are configured this way
<Hotkey 1>
<SendLabel w1>
<Key 1>
<SendLabel w2>
<Key Ctrl W>
This example says that when you press 1, "w1" which is defined above as the window called Book1 on the main PC, then Book1 receives the key 1. "w2" which is defined as the window called "Book2" on the remote PC receives the key Ctrl W.
redree
12-02-2013, 03:34 AM
Thank you dear for your reply
i have tried your instruction but same still i don't have enough experience to write the correct code, can you please write me the code with bellow argument.
1-Sendpc Local
2-file path : C:\Users\redree\Desktop\Book1.xlsm
3- rename file to "project"
4-Hotkey "F10"
5-Key "Ctrl w"
thank you very much.
Khatovar
12-02-2013, 04:07 AM
I suggest you review the information on the HotKeyNet site to learn how to use the program to suit your needs. Anything outside of multiboxing video games falls beyond the scope of my knowledge and this site's content. I believe I have provided enough explanation for you to be able to plug in all the required information already and I have no experience with remote PC useage or what you're trying to do to be able to troubleshoot any further.
redree
12-02-2013, 05:05 AM
thank you man
vBulletin® v4.2.2, Copyright ©2000-2025, Jelsoft Enterprises Ltd.