il tuo errore stà nel fatto che ore non può essere una variabile di tipo Date, perchè la funzione restituisce un valore Variant(Long)