AHK: Excel, check data

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

AHK: Excel, check data

13 Feb 2019, 01:43

Hi guys, I have a cell with the date format dd.MM.yyyy, for some reason my code only works under dd

Code: Select all


Path = %A_Desktop%/*.xlsx
Xl := ComObjCreate("Excel.Application")
Xl.Workbooks.Open(Path) ;выбрать файл для проверки
Xl.Visible := True

loop 100 {

FormatTime, TimeString, 20171020, dd.MM.yyyy
var := Xl.cells(A_Index + 1,7).value 

	IF (var > timestring) {
		MsgBox % var
	}

}

hd0202
Posts: 183
Joined: 04 Oct 2013, 03:07
Location: Germany near Cologne

Re: AHK: Excel, check data

14 Feb 2019, 05:34

dates can only be usefully compared as yyyy.MM.dd

Code: Select all

Path = %A_Desktop%/*.xlsx
Xl := ComObjCreate("Excel.Application")
Xl.Workbooks.Open(Path) ;выбрать файл для проверки
Xl.Visible := True

loop 100 {

; FormatTime, TimeString, 20171020, dd.MM.yyyy
var := Xl.cells(A_Index + 1,7).value 
formattime, var_ymd, var, yyyyMMdd

;	IF (var > timestring) {
	IF (var_vmd > "20171020") {
		MsgBox % var
	}

}
Hubert

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: No registered users and 123 guests