Search found 1265 matches

by JoeWinograd
05 Mar 2015, 00:53
Forum: Ask For Help
Topic: ComObjectActive for Excel
Replies: 27
Views: 8403

Re: ComObjectActive for Excel

> Btw, why does Excel get registered in the ROT when the non-persistent script runs? Answering my own question - running the AHK script takes focus away from Excel, which allows it to register in the ROT at that time. But I still can't answer the second question - how can the script register Excel w...
by JoeWinograd
04 Mar 2015, 23:54
Forum: Ask For Help
Topic: ComObjectActive for Excel
Replies: 27
Views: 8403

Re: ComObjectActive for Excel

Brilliant! Minimize/Restore does the trick! Is there a way that my script can register Excel in the ROT without doing a WinMinimize/WinRestore? I'd like the user of the script not to see the Excel window "flash" like that. Btw, why does Excel get registered in the ROT when the non-persistent script...
by JoeWinograd
03 Mar 2015, 22:03
Forum: Ask For Help
Topic: ComObjectActive for Excel
Replies: 27
Views: 8403

Re: ComObjectActive for Excel

I think I know why it works for flyingDman and not for me. I'm guessing he put this one line in a non-persistent script: msgbox % ComObjActive("Excel.Application").ActiveWorkbook.Path I just did that - works great, even the first time. But try putting it in a persistent script, such as: F12:: ; of c...
by JoeWinograd
03 Mar 2015, 03:10
Forum: Ask For Help
Topic: ComObjectActive for Excel
Replies: 27
Views: 8403

Re: ComObjectActive for Excel

I'm hoping some other folks in this forum can provide additional data points on this issue. Here's the simple, 3-line script: F12:: ; of course, use whatever hotkey you want msgbox % ComObjActive("Excel.Application").ActiveWorkbook.Path return flyingDman says it works with no problem in Office 2010....
by JoeWinograd
02 Mar 2015, 13:36
Forum: Ask For Help
Topic: ComObjectActive for Excel
Replies: 27
Views: 8403

Re: ComObjectActive for Excel

flyingDman, I created this script using your line of code: !F12:: msgbox % ComObjActive("Excel.Application").ActiveWorkbook.Path return Opened an Excel spreadsheet, hit Alt-F12, and the first run gave this: http://i.imgur.com/oy2KGwq.jpg http://i.imgur.com/d0xHV4i.jpg Clicked Yes to continue running...
by JoeWinograd
02 Mar 2015, 12:15
Forum: Ask For Help
Topic: ComObjectActive for Excel
Replies: 27
Views: 8403

Re: ComObjectActive for Excel

A very strange thing is happening (tested on both Excel 2007 and 2013). The call to ComObjActive("Excel.Application").ActiveWorkbook.Path fails the first time with Error 0x800401E3 - Operation unavailable . I click Yes to continue running the script - and it works the second time! And all subsequent...
by JoeWinograd
01 Mar 2015, 17:31
Forum: Ask For Help
Topic: ComObjectActive for Excel
Replies: 27
Views: 8403

Re: ComObjectActive for Excel

> "Operation unavailable" is the message you get if the target program isn't running. Yes, exactly! My error was that I was testing on a remote computer with Office 2007 (using TeamViewer) and the keystrokes I sent went to the local computer, not the remote computer. :( Once I ran the code on the re...
by JoeWinograd
01 Mar 2015, 16:32
Forum: Ask For Help
Topic: ComObjectActive for Excel
Replies: 27
Views: 8403

Re: ComObjectActive for Excel

flyingDman, Thanks for the test in Excel 2010. My bad on the post that said it didn't work in Office 2007. Operator error! It works fine with Excel, PowerPoint, Word 2007 . I also tested on a system with Excel, PowerPoint, Word 2003 and one with Excel, PowerPoint, Word 2010 - works on all of 'em! Th...
by JoeWinograd
01 Mar 2015, 15:18
Forum: Ask For Help
Topic: ComObjectActive for Excel
Replies: 27
Views: 8403

Re: ComObjectActive for Excel

I just tried it in Office 2007 - did not work. All three (Excel, PowerPoint, Word) generate this AHK message on the ComObjActive assignment statement:

Error 0x800401E3 - Operation unavailable

Perhaps the COM syntax is different in earlier Office releases. Regards, Joe
by JoeWinograd
01 Mar 2015, 12:08
Forum: Ask For Help
Topic: ComObjectActive for Excel
Replies: 27
Views: 8403

Re: ComObjectActive for Excel

For anyone interested in this thread, the technique also works for PowerPoint, both FullName and Path . Here's the code (tested only in Office 2013, not prior versions): ActiveFileFullName:=ComObjActive("PowerPoint.Application").ActivePresentation.FullName ActiveFilePath:=ComObjActive("PowerPoint.Ap...
by JoeWinograd
28 Feb 2015, 23:13
Forum: Ask For Help
Topic: ComObjectActive for Excel
Replies: 27
Views: 8403

Re: ComObjectActive for Excel

Hi kon,
Yes, that works perfectly! Nice simplification. And thanks for the link - I'll study it. Regards, Joe
by JoeWinograd
28 Feb 2015, 21:45
Forum: Ask For Help
Topic: ComObjectActive for Excel
Replies: 27
Views: 8403

Re: ComObjectActive for Excel

lexikos,
Thanks for the link to the MSDN doc and the explanation of why it can't be done more generally.

kon,
Thanks for the Path:= and Name:= code - works perfectly in Excel 2013!

Regards, Joe
by JoeWinograd
28 Feb 2015, 20:21
Forum: Ask For Help
Topic: ComObjectActive for Excel
Replies: 27
Views: 8403

ComObjectActive for Excel

This line of code works perfectly to retrieve the full file name (with drive and path) of the active Word document: ActiveFileFullName:=ComObjActive("Word.Application").ActiveDocument.FullName I tested that on Word 2013. I was expecting this corresponding call to work for an Excel file: ActiveFileFu...
by JoeWinograd
21 Jan 2015, 17:00
Forum: Ask For Help
Topic: GUI controls stop working after multiple uses
Replies: 20
Views: 2774

Re: GUI controls stop working after multiple uses

Hi MJs, OK, you meant to say Gui,Submit , not AltSubmit . Of course, Gui,Submit is what I was using before any of my recent threads here. The good news is that I learned about GuiControl , which can change a Text control ( Submit can't). Hi just me, Thanks for the sample code. I'll give it a spin an...
by JoeWinograd
20 Jan 2015, 20:47
Forum: Ask For Help
Topic: GUI controls stop working after multiple uses
Replies: 20
Views: 2774

Re: GUI controls stop working after multiple uses

OK, I read about AltSubmit. All that it seems to do is give you the position of the control rather than its text. Am I missing something?
by JoeWinograd
20 Jan 2015, 11:58
Forum: Ask For Help
Topic: GUI controls stop working after multiple uses
Replies: 20
Views: 2774

Re: GUI controls stop working after multiple uses

Those sound like great tips. I've never used A_GuiControl or Gui,Altsubmit, but I'll give them a try. Will post back here if I run into any problems. Thanks!
by JoeWinograd
20 Jan 2015, 10:39
Forum: Ask For Help
Topic: GUI controls stop working after multiple uses
Replies: 20
Views: 2774

Re: GUI controls stop working after multiple uses

> it's the max threads I thought that Gui,Destroy would terminate the thread. > don't know what WaitingForUserInput is for exactly, but if it's for the changes in the edit control "Comment" Yes, in the sample script, that's what it's for. But in the full script, it's for the changes in several contr...
by JoeWinograd
20 Jan 2015, 00:49
Forum: Ask For Help
Topic: GUI controls stop working after multiple uses
Replies: 20
Views: 2774

Re: GUI controls stop working after multiple uses

OK, I isolated the problem in a small script. Here it is: GuiXpos:="Center" GuiYpos:="Center" CurrentComment:="starting comment" StartOver: WaitingForUserInput:=true Gui,Add,Edit,vComment w400,%CurrentComment% Gui,Add,Button,x10 y220 w75,OK Gui,Add,Button,x90 y220 w75,Cancel Gui,Add,Button,x170 y220...
by JoeWinograd
19 Jan 2015, 22:05
Forum: Ask For Help
Topic: GUI controls stop working after multiple uses
Replies: 20
Views: 2774

Re: GUI controls stop working after multiple uses

> my suggestion was to use SciTE4AutoHotkey as a debugger OK, I'm willing to try again...the first time was a complete failure...didn't get the hang of it. > is it a change from GUI1 to GUI2 and vice versa GUI1 has a menu pick that takes it to GUI2, but GUI2 cannot go back to GUI1. > you change thos...
by JoeWinograd
19 Jan 2015, 21:10
Forum: Ask For Help
Topic: GUI controls stop working after multiple uses
Replies: 20
Views: 2774

Re: GUI controls stop working after multiple uses

> do you have an english version of windows Yes. > and you only use english language Yes. > which editor you use? It's called Kedit . Been using it for around 20 years. It's a plain text editor with a very powerful macro language (called KEXX, which is based on REXX). But it's not integrated in any ...

Go to advanced search