Search found 68 matches

by Datapoint
15 May 2019, 19:51
Forum: Ask For Help
Topic: Coloring the Excel Cell Topic is solved
Replies: 28
Views: 1626

Re: Coloring the Excel Cell Topic is solved

hasantr wrote:So it worked great. Thank you all. :)
Cool script. Glad to hear it works.
BTW the PixelGetColor default is BGR.

Code: Select all

PixelGetColor, OutputVar1, 500, 500, RGB
PixelGetColor, OutputVar2, 500, 500
MsgBox % Format("0x{:x}", OutputVar1) "`n" Format("0x{:x}", OutputVar2)
by Datapoint
14 May 2019, 22:00
Forum: Ask For Help
Topic: Coloring the Excel Cell Topic is solved
Replies: 28
Views: 1626

Re: Coloring the Excel Cell Topic is solved

If !IsObject(XL) XL := ComObjCreate("Excel.Application") Looks like you are creating instances of Excel without ever making them visible. And your script doesn't show quitting Excel or clearing the variables that contain COM objects. Both of these things can create hard-to-find problems for beginne...
by Datapoint
11 May 2019, 14:58
Forum: Ask For Help
Topic: Need Help With a RegexReplace function Topic is solved
Replies: 6
Views: 372

Re: Need Help With a RegexReplace function Topic is solved

I have a list. I want to remove everything that isn't "CG 707" so that is the only line items on my list after I run the script. I'm having a bit of trouble understanding what you want to do. So given this input you want to keep only the lines that contain "CG 707"? XW CG 707-WYUTWLCM1-BDIRCT037GT ...
by Datapoint
30 Apr 2019, 23:26
Forum: Ask For Help
Topic: How to call [class.function] from [class.function.subroutine]? Topic is solved
Replies: 4
Views: 292

Re: How to call [class.function] from [class.function.subroutine]? Topic is solved

Not sure. I think the thread that created the gui needs to still exist.

Code: Select all

	__New()
	{
		Gui, Add, Button,  h300 w300 gDoSomething, Button
		Gui, Show, w500 h500, abc
		WinWaitClose, abc
		return
		DoSomething:
			this.do_thing()
		return
	}
by Datapoint
28 Apr 2019, 14:25
Forum: Ask For Help
Topic: COM MS Word, call to GetPressedMso method
Replies: 5
Views: 375

Re: COM MS Word, call to GetPressedMso method

mslonik wrote:
24 Apr 2019, 03:16
You're right, I should use Google for that purpose prior to asking here.
Thanks, glad it helped. But I didn't mean it like, "Just google it." Just like you, I found it was hard and unintuitive to find the values. The first thing I checked was the Help/IDE but there wasn't anything there.
by Datapoint
22 Apr 2019, 08:38
Forum: Ask For Help
Topic: Attaching Excel Sheet
Replies: 24
Views: 1305

Re: Attaching Excel Sheet

Indhu wrote:
22 Apr 2019, 00:27
My AHK version is: 1.0.48.05, 32 bit, and ANSI encoding.
That's AHK "Basic" / "Classic". It doesn't have objects or COM etc. You need a newer version to use COM. (or use the old COM standard library with that version. Upgrade to AHK 1.1+ if possible)
by Datapoint
21 Apr 2019, 16:48
Forum: Ask For Help
Topic: COM MS Word, call to GetPressedMso method
Replies: 5
Views: 375

Re: COM MS Word, call to GetPressedMso method

mslonik wrote:
21 Apr 2019, 03:15
indeed I wasn't able to determine values of idMso. How did you manage to find it?
I think you could google "idMso" and get some good results.

The F7 hotkey from this script will show the commands that are available in your version of Word.
by Datapoint
19 Apr 2019, 15:37
Forum: Ask For Help
Topic: Issues working with two Excel files
Replies: 8
Views: 665

Re: Issues working with two Excel files

If you are trying to click on a cell: Excel_Get().ActiveCell.Activate (Works on the active window, unlike ComObjActive. And also works in multiple excel instances.) Although it is kind of redundant to click on the active cell. Do you just want to change the value or something? I don't understand why...
by Datapoint
13 Apr 2019, 09:29
Forum: Ask For Help
Topic: Issues working with two Excel files
Replies: 8
Views: 665

Re: Issues working with two Excel files

I am running each independent of each other (each can be open in its own screen)… Instead of: oExcel := ComObjActive("Excel.Application") try: oExcel := Excel_Get() - Excel_Get What is the COM table and how would one access it? :arrow: https://www.autohotkey.com/boards/viewtopic.php?p=134048#p134048
by Datapoint
01 Mar 2019, 19:23
Forum: Ask For Help
Topic: MS Word, inserting of Building Block
Replies: 2
Views: 317

Re: MS Word, inserting of Building Block

;~ oWord.ActiveDocument.Selection.Range.InsertAfter(VarTemp.BuildingBlockEntries("tabela")) ; it doesn't work To figure out by myself above problem I've used the following resources: 1. Macro recorded in MS Word: Sub Makro1() Application.Templates( _ "S:\OrgFirma\Szablony\Word\OgolneZmakrami\TQ-S40...
by Datapoint
24 Feb 2019, 12:14
Forum: Ask For Help
Topic: AHK: Excel_Autofilter
Replies: 3
Views: 409

Re: AHK: Excel_Autofilter

inseption86 wrote:
24 Feb 2019, 07:55

Code: Select all

Lang := xl.Worksheets(1).AutoFilter.Range.Columns("E").SpecialCells(12).row + 1.value ???????
SpecialCells returns a Range object, so you should be able to use Range.Offset like this:

Code: Select all

Lang := xl.Worksheets(1).AutoFilter.Range.Columns("E").SpecialCells(12).Offset(1, 0).Value
by Datapoint
24 Feb 2019, 12:01
Forum: Ask For Help
Topic: COM Error: 0x80070057
Replies: 3
Views: 449

Re: COM Error: 0x80070057

Can you please explain from where value 0xB comes from in your example: oWord.Selection.ParagraphFormat.KeepWithNext := ComObject(0xB, -1) Creates an object representing a typed value to be passed as a parameter or return value. ParamObj := ComObject(VarType, Value [, Flags]) 'VarType' determines t...
by Datapoint
22 Feb 2019, 21:11
Forum: Ask For Help
Topic: COM Error: 0x80070057
Replies: 3
Views: 449

Re: COM Error: 0x80070057

The value of "true" is actually -1 . 1 only works sometimes. As a last resort you can try x := := ComObject(0xB, -1) Try this: #IfWinActive, ahk_class OpusApp r:: oWord := ComObjActive("Word.Application") oWord.Selection.ParagraphFormat.KeepWithNext := -1 oWord := "" ; Clear global COM objects when ...
by Datapoint
01 Feb 2019, 16:16
Forum: Ask For Help
Topic: VBA to Ahk remove duplicates
Replies: 5
Views: 593

Re: VBA to Ahk remove duplicates

ActiveSheet.Range("$A$1:$G$13").RemoveDuplicates Columns:=Array(1, 7), Header _ :=xlYes VT_VARIANT := 0xC xlYes := 1 numberOfColumns := 2 Columns := ComObjArray(VT_VARIANT, numberOfColumns) Columns[0] := 1 Columns[1] := 7 xlApp := ComObjActive("Excel.Application") xlApp.ActiveSheet.Range("A1:G13")....
by Datapoint
27 Jan 2019, 15:24
Forum: Ask For Help
Topic: COM object script works inconsistently
Replies: 7
Views: 739

Re: COM object script works inconsistently

TLM wrote:
27 Jan 2019, 15:18
but why not use 1 object??
In case you close Word and open another instance before you reload the script?
by Datapoint
27 Jan 2019, 14:44
Forum: Ask For Help
Topic: COM object script works inconsistently
Replies: 7
Views: 739

Re: COM object script works inconsistently

TLM wrote:
27 Jan 2019, 14:43
Datapoint wrote:
27 Jan 2019, 14:40

Code: Select all

!Numpad2::ComObjActive("Word.Application").Selection.Range.HighlightColorIndex := 4 ;highlight color

!Numpad3::ComObjActive("Word.Application").Selection.Range.HighlightColorIndex := 3 ;highlight color
these will not work as objects in AHk must be assigned.
u sure?
by Datapoint
27 Jan 2019, 14:40
Forum: Ask For Help
Topic: COM object script works inconsistently
Replies: 7
Views: 739

Re: COM object script works inconsistently

#NoEnv #SingleInstance force #1:: !Numpad1:: oWord := ComObjActive("Word.Application") ; MS Word object oWord.Selection.Range.HighlightColorIndex := 7 ;highlight color ; Clear global COM variables when you are done with them. (or don't save them at all, as in the next example) ; If you have a refer...
by Datapoint
25 Jan 2019, 19:24
Forum: Ask For Help
Topic: Word-COM: Create hyperlinks Topic is solved
Replies: 3
Views: 490

Re: Word-COM: Create hyperlinks Topic is solved

;Create hyperlink F2:: x++ ; Incrementer hyperlink = Kapitel%i% ; Name of the bookmark = Kapitel + incrementer, eg Kapitel1 wd := ComObjActive("Word.Application") ; Connection to currently active Word instance Send {Home} ; Jump to start of line Sleep, d Send +{End} ; Mark whole line Sleep, d Send ...
by Datapoint
23 Jan 2019, 09:10
Forum: Ask For Help
Topic: Open Excel or when already active go to active Excel window
Replies: 8
Views: 1269

Re: Open Excel or when active go to specified Excel window

If WinExist isn't finding the window then check TitleMatchMode. It is probably set to 1. Try 2 instead.
https://www.autohotkey.com/docs/commands/SetTitleMatchMode.htm

Go to advanced search