Gui calendar to excel Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
inseption86
Posts: 201
Joined: 19 Apr 2018, 00:24

Gui calendar to excel

22 Jun 2018, 15:04

Hi, please help, i have:

Code: Select all


path = .............................xlsx
Xl := ComObjCreate("Excel.Application")
Xl.Workbooks.Open(Path)
Xl.Visible := true

xl.Worksheets(1).activate

 If (xl.Worksheets(1).FilterMode)
	xl.Worksheets(1).ShowAllData

Gui, Add, DateTime, w153 vMyDateTime, 'Date1:' dd.MM.yyyy

Gui, Add, Button, x+5 hp gDateRoutine, Go

Gui, Show

DateRoutine:

Gui, Submit, NoHide
 
FormatTime, Date1, dd.MM.yyyy

 xl.Worksheets(1).Range("A1:AX1").AutoFilter(18, ">=" Date1, xlAnd := 1, "<=" "22.06.2018") 

Is not working
User avatar
TLM
Posts: 1608
Joined: 01 Oct 2013, 07:52
Contact:

Re: Gui calendar to excel

22 Jun 2018, 19:11

Please describe exactly what isn't working.
Just from eyeballing the script, you're missing some returns

Code: Select all

;...........
Gui, Show
Return ; << add return or the script will continue to run the below routine!

DateRoutine:

Gui, Submit, NoHide
 
FormatTime, Date1, dd.MM.yyyy
msgbox % Date1
 xl.Worksheets( 1 ).Range( "A1:AX1" ).AutoFilter( 18, ">=" Date1, xlAnd := 1, "<=" "22.06.2018" ) 
Return
Be more specific!
inseption86
Posts: 201
Joined: 19 Apr 2018, 00:24

Re: Gui calendar to excel

23 Jun 2018, 02:05

TLM wrote: there is a choice of today's date, and not the one that I choose on the calendar
inseption86
Posts: 201
Joined: 19 Apr 2018, 00:24

Re: Gui calendar to excel  Topic is solved

23 Jun 2018, 05:00

Gui, Add, Text, , First Date:
Gui, Add, DateTime, vFirstDate Section,

Gui, Add, Text, , Second Date:
Gui, Add, DateTime, vSecondDate Section,

Gui, Add, Button, Default, &OK
Gui, Show, w190 h130, Data
Return

ButtonOK:
Gui, submit, nohide

FormatTime, FirstDate , %FirstDate% , dd.MM.yyyy
FormatTime, SecondDate , %SecondDate% , dd.MM.yyyy

xl.Worksheets( 1 ).Range( "A1:AX1" ).AutoFilter( 18, ">=" FirstDate, xlAnd := 1, "<=" SecondDate )

GuiClose:
Gui, Destroy

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: No registered users and 301 guests