ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Is DATE somehow different in XL 2003 SP3? (https://www.excelbanter.com/excel-discussion-misc-queries/170113-date-somehow-different-xl-2003-sp3.html)

Romolo

Is DATE somehow different in XL 2003 SP3?
 
Hi,
the following macro has always worked fine in XL 200 and 2003 environments,
and is still working well in XL 2003 SP3, BUT, once executed at this level
and then exported down to both the previous XL level systems, it stops al
the ***** signalled code, being unable to resolve the DATE instruction (?!?!).
Have you ever heard something like that?

Thanks in advance for any help
Romolo


Private Function evento(ByVal classe As String, StPoint As Integer) As Integer
Application.Volatile

'restituisce il puntatore dell'evento nella lista degli eventi inseriti in
Calendario
On Error GoTo handlerror
Dim errdes As String
Dim Lista_Eventi As Range
Dim Classi As Range
Dim Rientri As Range
Dim Rientro As Date
Dim i As Integer
Dim j As Integer
Dim k As Integer
Dim test As String
Set Classi = ThisWorkbook.Worksheets("CSorted").Range("H3:L200" )

Set Lista_Eventi = ThisWorkbook.Worksheets("CSorted").Range("D3:D200" )
Set Rientri = ThisWorkbook.Worksheets("CSorted").Range("G3:G200" )
StPoint = StPoint + 1
For i = StPoint To 200 'i = puntatore lista eventi = n. riga
If Not IsDate(Rientri(i)) Then
Exit Function
Else
Rientro = Rientri(i)
End If

'*****************
If Rientro < Date Then GoTo ispassed 'HERE it stops
'*****************

For j = 1 To 5 'J = puntatore classi partecipanti all'evento = n.
colonna
test = UCase(Classi(i, j))
test = Trim(test)
If test = "" Then Exit For
If classe = test Then
evento = i
Exit Function
End If
Next j
ispassed:
Next i
evento = 0
Exit Function
handlerror:
errdes = Err.Description
End Function
--
grazie, Romolo

joel

Is DATE somehow different in XL 2003 SP3?
 
I think you may havve problems if StPoint doesn't start with 3. If it starts
with for then Rientri(1) is cell G4

Why don't youtry something like this
For i = StPoint To 200
If Not IsDate(Range("G" & i)) Then
Exit Function
Else
Rientro = Range("G" & i)


"Romolo" wrote:

Hi,
the following macro has always worked fine in XL 200 and 2003 environments,
and is still working well in XL 2003 SP3, BUT, once executed at this level
and then exported down to both the previous XL level systems, it stops al
the ***** signalled code, being unable to resolve the DATE instruction (?!?!).
Have you ever heard something like that?

Thanks in advance for any help
Romolo


Private Function evento(ByVal classe As String, StPoint As Integer) As Integer
Application.Volatile

'restituisce il puntatore dell'evento nella lista degli eventi inseriti in
Calendario
On Error GoTo handlerror
Dim errdes As String
Dim Lista_Eventi As Range
Dim Classi As Range
Dim Rientri As Range
Dim Rientro As Date
Dim i As Integer
Dim j As Integer
Dim k As Integer
Dim test As String
Set Classi = ThisWorkbook.Worksheets("CSorted").Range("H3:L200" )

Set Lista_Eventi = ThisWorkbook.Worksheets("CSorted").Range("D3:D200" )
Set Rientri = ThisWorkbook.Worksheets("CSorted").Range("G3:G200" )
StPoint = StPoint + 1
For i = StPoint To 200 'i = puntatore lista eventi = n. riga
If Not IsDate(Rientri(i)) Then
Exit Function
Else
Rientro = Rientri(i)
End If

'*****************
If Rientro < Date Then GoTo ispassed 'HERE it stops
'*****************

For j = 1 To 5 'J = puntatore classi partecipanti all'evento = n.
colonna
test = UCase(Classi(i, j))
test = Trim(test)
If test = "" Then Exit For
If classe = test Then
evento = i
Exit Function
End If
Next j
ispassed:
Next i
evento = 0
Exit Function
handlerror:
errdes = Err.Description
End Function
--
grazie, Romolo


Romolo

Is DATE somehow different in XL 2003 SP3?
 
Joel,
the problem is definitively related to "Date" instruction, in fact, when I
use any

statement like "Year(Date)", I get the message "Compilation error ....
unable to

find the project or library".
Help on-line suggests that probably that is due to an unresolved reference.
Looking trough VBA references, I see that Ref Edit is missing.
Could that be the original cause? If so, how can I resolve?
Note that this problem appears in all XL 2000/2003 systems where I tried to
run
my XL 2003 SP3 procedure, where previously (before running SP3) everything
was ok.


grazie, Romolo


"Joel" wrote:

I think you may havve problems if StPoint doesn't start with 3. If it starts
with for then Rientri(1) is cell G4

Why don't youtry something like this
For i = StPoint To 200
If Not IsDate(Range("G" & i)) Then
Exit Function
Else
Rientro = Range("G" & i)


"Romolo" wrote:

Hi,
the following macro has always worked fine in XL 200 and 2003 environments,
and is still working well in XL 2003 SP3, BUT, once executed at this level
and then exported down to both the previous XL level systems, it stops al
the ***** signalled code, being unable to resolve the DATE instruction (?!?!).
Have you ever heard something like that?

Thanks in advance for any help
Romolo


Private Function evento(ByVal classe As String, StPoint As Integer) As Integer
Application.Volatile

'restituisce il puntatore dell'evento nella lista degli eventi inseriti in
Calendario
On Error GoTo handlerror
Dim errdes As String
Dim Lista_Eventi As Range
Dim Classi As Range
Dim Rientri As Range
Dim Rientro As Date
Dim i As Integer
Dim j As Integer
Dim k As Integer
Dim test As String
Set Classi = ThisWorkbook.Worksheets("CSorted").Range("H3:L200" )

Set Lista_Eventi = ThisWorkbook.Worksheets("CSorted").Range("D3:D200" )
Set Rientri = ThisWorkbook.Worksheets("CSorted").Range("G3:G200" )
StPoint = StPoint + 1
For i = StPoint To 200 'i = puntatore lista eventi = n. riga
If Not IsDate(Rientri(i)) Then
Exit Function
Else
Rientro = Rientri(i)
End If

'*****************
If Rientro < Date Then GoTo ispassed 'HERE it stops
'*****************

For j = 1 To 5 'J = puntatore classi partecipanti all'evento = n.
colonna
test = UCase(Classi(i, j))
test = Trim(test)
If test = "" Then Exit For
If classe = test Then
evento = i
Exit Function
End If
Next j
ispassed:
Next i
evento = 0
Exit Function
handlerror:
errdes = Err.Description
End Function
--
grazie, Romolo



All times are GMT +1. The time now is 12:51 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com