![]() |
changes in the date function from 2000 to 2003?
I've got some code that uses the date function.
The computer I am using runs win2000pro and xl2000. The code below works just fine. If sD = 0 Then selectDate = Date Else selectDate = sD End If But on all computers with winXP pro and xl2003 it stops on the line 'selectDate = Date' saying that the object is not defined or there is no library reference available. Any ideas why? |
changes in the date function from 2000 to 2003?
Date is a reserved word for the Date type. ie you could legally use it like: dim d as date I don't know if it's a version thing, I'm supprised "= Date" ever worked. You might be looking for the "now()" function which returns the current system time? - Rm "JNW" wrote: I've got some code that uses the date function. The computer I am using runs win2000pro and xl2000. The code below works just fine. If sD = 0 Then selectDate = Date Else selectDate = sD End If But on all computers with winXP pro and xl2003 it stops on the line 'selectDate = Date' saying that the object is not defined or there is no library reference available. Any ideas why? |
changes in the date function from 2000 to 2003?
Hi Robert,
Date is a reserved word for the Date type. Date is a VBA functio which returns the system date. From the immediate window: ?Date 07/10/2005 --- Regards, Norman "Robert Mulroney" '''' wrote in message ... Date is a reserved word for the Date type. ie you could legally use it like: dim d as date I don't know if it's a version thing, I'm supprised "= Date" ever worked. You might be looking for the "now()" function which returns the current system time? - Rm "JNW" wrote: I've got some code that uses the date function. The computer I am using runs win2000pro and xl2000. The code below works just fine. If sD = 0 Then selectDate = Date Else selectDate = sD End If But on all computers with winXP pro and xl2003 it stops on the line 'selectDate = Date' saying that the object is not defined or there is no library reference available. Any ideas why? |
changes in the date function from 2000 to 2003?
Hi JNW,
On the problem computer, in the VBE go to Tools | References and look for any references marked as "MISSING". Either uncheck the reference or, if the reference is needed, try the browse button to locate the library, --- Regards, Norman "JNW" wrote in message ... I've got some code that uses the date function. The computer I am using runs win2000pro and xl2000. The code below works just fine. If sD = 0 Then selectDate = Date Else selectDate = sD End If But on all computers with winXP pro and xl2003 it stops on the line 'selectDate = Date' saying that the object is not defined or there is no library reference available. Any ideas why? |
changes in the date function from 2000 to 2003?
so it is. Live and learn don't you.
- Rm "Norman Jones" wrote: Hi Robert, Date is a reserved word for the Date type. Date is a VBA functio which returns the system date. From the immediate window: ?Date 07/10/2005 --- Regards, Norman "Robert Mulroney" '''' wrote in message ... Date is a reserved word for the Date type. ie you could legally use it like: dim d as date I don't know if it's a version thing, I'm supprised "= Date" ever worked. You might be looking for the "now()" function which returns the current system time? - Rm "JNW" wrote: I've got some code that uses the date function. The computer I am using runs win2000pro and xl2000. The code below works just fine. If sD = 0 Then selectDate = Date Else selectDate = sD End If But on all computers with winXP pro and xl2003 it stops on the line 'selectDate = Date' saying that the object is not defined or there is no library reference available. Any ideas why? |
changes in the date function from 2000 to 2003?
Norman,
Thank you for your help. I actually looked for a missing reference prior to posting and didn't see one. Also, all of the same references are checked on both computers. Is there another function that is usable instead of DATE in case the problem cannot be resolved (if I submit a ticket to IT to update the references it will never happen) Thanks again, JNW "Norman Jones" wrote: Hi JNW, On the problem computer, in the VBE go to Tools | References and look for any references marked as "MISSING". Either uncheck the reference or, if the reference is needed, try the browse button to locate the library, --- Regards, Norman "JNW" wrote in message ... I've got some code that uses the date function. The computer I am using runs win2000pro and xl2000. The code below works just fine. If sD = 0 Then selectDate = Date Else selectDate = sD End If But on all computers with winXP pro and xl2003 it stops on the line 'selectDate = Date' saying that the object is not defined or there is no library reference available. Any ideas why? |
changes in the date function from 2000 to 2003?
Hi Robert,
Is there another function that is usable instead of DATE in case the problem cannot be resolved (if I submit a ticket to IT to update the references it will never happen) I very much doubt that there is any intrinsic problem with the Date function. Thank you for your help. I actually looked for a missing reference prior to posting and didn't see one. Also, all of the same references are checked on both computers. At the risk of engendering your ire, I am still going to plump for the reference problem. So, if you are prepared to humour me: Close all workbooks except for the workbook in question Run the problematic code When the code errors, go to the VBE and select the project in the Project Explorer window Hit the reset button and look at the Tools | References list - are you *sure* that no references are marked "Missing"? --- Regards, Norman "JNW" wrote: Norman, Thank you for your help. I actually looked for a missing reference prior to posting and didn't see one. Also, all of the same references are checked on both computers. Is there another function that is usable instead of DATE in case the problem cannot be resolved (if I submit a ticket to IT to update the references it will never happen) Thanks again, JNW "Norman Jones" wrote: Hi JNW, On the problem computer, in the VBE go to Tools | References and look for any references marked as "MISSING". Either uncheck the reference or, if the reference is needed, try the browse button to locate the library, --- Regards, Norman "JNW" wrote in message ... I've got some code that uses the date function. The computer I am using runs win2000pro and xl2000. The code below works just fine. If sD = 0 Then selectDate = Date Else selectDate = sD End If But on all computers with winXP pro and xl2003 it stops on the line 'selectDate = Date' saying that the object is not defined or there is no library reference available. Any ideas why? |
changes in the date function from 2000 to 2003?
Norman,
Thanks again. That did it. Don't worry about "engendering ire". I'm new enough with this that sometimes all it takes is a second look. JNW "Norman Jones" wrote: Hi Robert, Is there another function that is usable instead of DATE in case the problem cannot be resolved (if I submit a ticket to IT to update the references it will never happen) I very much doubt that there is any intrinsic problem with the Date function. Thank you for your help. I actually looked for a missing reference prior to posting and didn't see one. Also, all of the same references are checked on both computers. At the risk of engendering your ire, I am still going to plump for the reference problem. So, if you are prepared to humour me: Close all workbooks except for the workbook in question Run the problematic code When the code errors, go to the VBE and select the project in the Project Explorer window Hit the reset button and look at the Tools | References list - are you *sure* that no references are marked "Missing"? --- Regards, Norman "JNW" wrote: Norman, Thank you for your help. I actually looked for a missing reference prior to posting and didn't see one. Also, all of the same references are checked on both computers. Is there another function that is usable instead of DATE in case the problem cannot be resolved (if I submit a ticket to IT to update the references it will never happen) Thanks again, JNW "Norman Jones" wrote: Hi JNW, On the problem computer, in the VBE go to Tools | References and look for any references marked as "MISSING". Either uncheck the reference or, if the reference is needed, try the browse button to locate the library, --- Regards, Norman "JNW" wrote in message ... I've got some code that uses the date function. The computer I am using runs win2000pro and xl2000. The code below works just fine. If sD = 0 Then selectDate = Date Else selectDate = sD End If But on all computers with winXP pro and xl2003 it stops on the line 'selectDate = Date' saying that the object is not defined or there is no library reference available. Any ideas why? |
All times are GMT +1. The time now is 05:37 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com