AHK: Excel, check data

Get help with using AutoHotkey and its commands and hotkeys
inseption86
Posts: 67
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: 99
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”

Who is online

Users browsing this forum: Odlanir, Rohwedder and 201 guests