Search found 1210 matches

by JoeWinograd
08 Nov 2014, 15:11
Forum: Ask For Help
Topic: ComObject to create Excel 97-2003 file with Excel 2007-2013
Replies: 3
Views: 1097

ComObject to create Excel 97-2003 file with Excel 2007-2013

I am using the following code to create a new Excel file: ExcelFile:="c:\temp\createdbyahk.xlsx" oExcel:=ComObjCreate("Excel.Application") oExcel.Workbooks.Add() oExcel.ActiveWorkbook.SaveAs(ExcelFile) oExcel.Quit() I tested it in Excel 2007 and 2013 - works fine in both (and probably in 2010, altho...
by JoeWinograd
08 Nov 2014, 10:17
Forum: Ask For Help
Topic: How to use ComObject to write to an Excel cell
Replies: 14
Views: 5953

Re: How to use ComObject to write to an Excel cell

I just noticed at the documentation page that there *is* a Height param - the last four params in the syntax are Left, Top, Width, Height. But there are two mistakes in the Parameters section that I missed at first: (1) The description of the Height param right under the ClassType param is not reall...
by JoeWinograd
07 Nov 2014, 19:37
Forum: Ask For Help
Topic: How to use ComObject to write to an Excel cell
Replies: 14
Views: 5953

Re: How to use ComObject to write to an Excel cell

kon, Once again, that works perfectly! Thank you very much! Also, thanks for the link to the Add Method doc. I was wondering if there's a way to specify the size of the object and it seems that the Width parameter does that, although there doesn't appear to be a Height param. It's also good to know ...
by JoeWinograd
07 Nov 2014, 17:30
Forum: Ask For Help
Topic: How to use ComObject to write to an Excel cell
Replies: 14
Views: 5953

Re: How to use ComObject to write to an Excel cell

Hi kon, I hope you can help me with a follow-up to this question. I want to use ComObj in an AHK script to embed/insert an object (an existing file) into an Excel worksheet and display it as an icon. In other words, the programmatic equivalent of these manual steps in Excel: Insert Object Create fro...
by JoeWinograd
06 Nov 2014, 16:05
Forum: Ask For Help
Topic: How to use ComObject to write to an Excel cell
Replies: 14
Views: 5953

Re: How to use ComObject to write to an Excel cell

Hi kon,
Absolutely perfect! Works a charm! Thanks to GeekDude for getting it started and to kon for taking it over the top. Much appreciated! Regards, Joe
by JoeWinograd
06 Nov 2014, 14:24
Forum: Ask For Help
Topic: How to use ComObject to write to an Excel cell
Replies: 14
Views: 5953

Re: How to use ComObject to write to an Excel cell

Good point! What is the code for saving it?
by JoeWinograd
06 Nov 2014, 14:15
Forum: Ask For Help
Topic: How to use ComObject to write to an Excel cell
Replies: 14
Views: 5953

Re: How to use ComObject to write to an Excel cell

GeekDude, Thanks for the suggestion. I just tried this: fn:="c:\temp\testahkcomwrite.xlsx" CellValue:="test write to excel" oWorkbook:=ComObjGet(fn) oWorkbook.Worksheets(1).Range("B5").Value:=CellValue It didn't write to B5. It didn't modify the XLSX file at all - the contents (and the date/time sta...
by JoeWinograd
06 Nov 2014, 13:31
Forum: Ask For Help
Topic: How to use ComObject to write to an Excel cell
Replies: 14
Views: 5953

How to use ComObject to write to an Excel cell

Hi AHK Experts, I use ComObjGet to read the contents of an Excel cell. For example, the following snippet will read the contents FROM cell B5 into the variable CellValue: fn:="c:\temp\testreadahk.xlsx" oWorkbook:=ComObjGet(fn) CellValue:=oWorkbook.Worksheets(1).Range("B5").Value What is the code for...
by JoeWinograd
14 Sep 2014, 09:45
Forum: Ask For Help
Topic: Boolean Search as the needle searching a haystack
Replies: 52
Views: 7113

Re: Boolean Search as the needle searching a haystack

Hi Coco,
Thanks for that! I think the AHK folks should have an entry for Classes in the command/function index. They do have one for Object. Thanks again, Joe
by JoeWinograd
13 Sep 2014, 23:51
Forum: Ask For Help
Topic: Boolean Search as the needle searching a haystack
Replies: 52
Views: 7113

Re: Boolean Search as the needle searching a haystack

Hi LinearSpoon, Hoping to hear back from you on my question about this code: class symbols { __New() { this.pos := 1 } advance() { return this[++this.pos] } current() { return this[this.pos] } end() { return this[this.pos] = "" } } I can't even figure out why it compiles - "class symbols" is not a f...
by JoeWinograd
13 Sep 2014, 23:49
Forum: Ask For Help
Topic: Boolean Search as the needle searching a haystack
Replies: 52
Views: 7113

Re: Boolean Search as the needle searching a haystack

Hi FG,
Thank you for adding the word boundary option - especially nice that you included both left and right boundaries. Regards, Joe
by JoeWinograd
11 Sep 2014, 00:34
Forum: Ask For Help
Topic: Boolean Search as the needle searching a haystack
Replies: 52
Views: 7113

Re: Boolean Search as the needle searching a haystack

I'm packing it in for tonight. Will check back into the thread late Thursday night or Friday morning US Central Time. Thanks to everyone! Regards, Joe
by JoeWinograd
11 Sep 2014, 00:28
Forum: Ask For Help
Topic: Boolean Search as the needle searching a haystack
Replies: 52
Views: 7113

Re: Boolean Search as the needle searching a haystack

Thanks for the explanation on grammar, syntax, and the recursive descent parser. If you are talking about x := new symbols, No, I'm talking about: class symbols { __New() { this.pos := 1 } advance() { return this[++this.pos] } current() { return this[this.pos] } end() { return this[this.pos] = "" } ...
by JoeWinograd
10 Sep 2014, 23:26
Forum: Ask For Help
Topic: Boolean Search as the needle searching a haystack
Replies: 52
Views: 7113

Re: Boolean Search as the needle searching a haystack

ahcahc wrote:If expr is still not 1 and still not 0 after 501 tries, it will return an error. The loop count should be equal to the total numbers of operators used, but to be sure I made it 501.
OK, got it!
by JoeWinograd
10 Sep 2014, 23:06
Forum: Ask For Help
Topic: Boolean Search as the needle searching a haystack
Replies: 52
Views: 7113

Re: Boolean Search as the needle searching a haystack

Our last two messages crossed, but I see that the A_Index>500 test is still there, which I'd like to understand. I'll test the new code on Friday (it's getting late here on Wednesday night and I'm tied up all day and night Thursday). Thanks for the update! Regards, Joe
by JoeWinograd
10 Sep 2014, 22:59
Forum: Ask For Help
Topic: Boolean Search as the needle searching a haystack
Replies: 52
Views: 7113

Re: Boolean Search as the needle searching a haystack

Hi ahcahc,
I was just reviewing this thread and noticed this code in your last post that wasn't there before:

if (A_Index>500)
return "Invalid or Incomplete Expression`n" tmp "`nAllowed Characters: 1 0 ( ) " op_and " " op_or " " op_not

What is its purpose? Why 500? Thanks, Joe
by JoeWinograd
10 Sep 2014, 22:51
Forum: Ask For Help
Topic: Boolean Search as the needle searching a haystack
Replies: 52
Views: 7113

Re: Boolean Search as the needle searching a haystack

Hi LinearSpoon, Your code has worked on everything I've tried. Nice approach on the test cases - great idea being able to process all of them in a single run via the loop/parse/`n technique. It throws an error on un-paired parentheses, as you anticipated with the Throw command, and that's fine - as ...
by JoeWinograd
10 Sep 2014, 22:30
Forum: Ask For Help
Topic: Boolean Search as the needle searching a haystack
Replies: 52
Views: 7113

Re: Boolean Search as the needle searching a haystack

Hi FG, I've been testing your updated code that removes the superfluous parens. It has worked on many complex expressions, but amazingly fails on this simple one: Haystack:="hello world" Needle:="goodbye" Should be FALSE, but comes up TRUE. You're right about keeping things simple for the users, but...
by JoeWinograd
10 Sep 2014, 13:26
Forum: Ask For Help
Topic: Boolean Search as the needle searching a haystack
Replies: 52
Views: 7113

Re: Boolean Search as the needle searching a haystack

Hi ahcahc, The new eval_logic code works great when the search term is valid (at least, none of my tests has failed yet). However, if the search term contains unpaired parentheses or one of the three invalid search characters, it hangs. For example, a search for AutoHotkey) or AutoHotkey%op_and% han...
by JoeWinograd
10 Sep 2014, 09:37
Forum: Ask For Help
Topic: Boolean Search as the needle searching a haystack
Replies: 52
Views: 7113

Re: Boolean Search as the needle searching a haystack

Hi ahcahc, FanaticGuru, and LinearSpoon, Sorry for the delayed response, but I am in the US Central Time zone and all of this occurred while I was sleeping. Thanks to all of you for your efforts in improving the solution. I'll try to do some testing later today and Friday (I'm tied up this morning a...

Go to advanced search