PC Review


Reply
Thread Tools Rate Thread

Date type library

 
 
madeleine
Guest
Posts: n/a
 
      22nd Nov 2006
Hi

I'm hoping that someone can help me on this, I'm sure I must be going
mad, I'm trying to declare something as VbShortDate, I get told that I
need to include its type library, I can't actually find out what type
library it lives in.

Hopefully someone can tell me what box to tick in the references menu.

All help much appreciated.

Thanks

Madeleine

 
Reply With Quote
 
 
 
 
=?Utf-8?B?VG9tIE9naWx2eQ==?=
Guest
Posts: n/a
 
      22nd Nov 2006
from the object browser in the VBE

Const vbShortDate = 2
Member of VBA.VbDateTimeFormat

so it is a member of the VBA type library.

However, it is a constant, not a data type, I don't see how you could
declare something as type vbShortDate. You would declare it as date and
format it as vbshortdate.

--
Regards,
Tom Ogilvy


"madeleine" wrote:

> Hi
>
> I'm hoping that someone can help me on this, I'm sure I must be going
> mad, I'm trying to declare something as VbShortDate, I get told that I
> need to include its type library, I can't actually find out what type
> library it lives in.
>
> Hopefully someone can tell me what box to tick in the references menu.
>
> All help much appreciated.
>
> Thanks
>
> Madeleine
>
>

 
Reply With Quote
 
=?Utf-8?B?R2FyeSBCcm93bg==?=
Guest
Posts: n/a
 
      22nd Nov 2006
The Library Reference is 'VBA'...

Description
Visual Basic For Applications
Name
VBA
GUID
{000204EF-0000-0000-C000-000000000046}
Path
C:\Program Files\Common Files\Microsoft Shared\VBA\VBA6\VBE6.DLL

--
HTH,
Gary Brown
(E-Mail Removed)
If this post was helpful to you, please select ''YES'' at the bottom of the
post.



"madeleine" wrote:

> Hi
>
> I'm hoping that someone can help me on this, I'm sure I must be going
> mad, I'm trying to declare something as VbShortDate, I get told that I
> need to include its type library, I can't actually find out what type
> library it lives in.
>
> Hopefully someone can tell me what box to tick in the references menu.
>
> All help much appreciated.
>
> Thanks
>
> Madeleine
>
>

 
Reply With Quote
 
madeleine
Guest
Posts: n/a
 
      22nd Nov 2006
Aha Tom thanks.

What I was trying to do was get rid of the time aspect from a date,
such that I could compare two dates without having to worry about
whether it was at 8 in the morning or midday. Is this something that
you think vbShortDate could help with?

Thanks again

Madeleine
Tom Ogilvy wrote:
> from the object browser in the VBE
>
> Const vbShortDate = 2
> Member of VBA.VbDateTimeFormat
>
> so it is a member of the VBA type library.
>
> However, it is a constant, not a data type, I don't see how you could
> declare something as type vbShortDate. You would declare it as date and
> format it as vbshortdate.
>
> --
> Regards,
> Tom Ogilvy
>
>
> "madeleine" wrote:
>
> > Hi
> >
> > I'm hoping that someone can help me on this, I'm sure I must be going
> > mad, I'm trying to declare something as VbShortDate, I get told that I
> > need to include its type library, I can't actually find out what type
> > library it lives in.
> >
> > Hopefully someone can tell me what box to tick in the references menu.
> >
> > All help much appreciated.
> >
> > Thanks
> >
> > Madeleine
> >
> >


 
Reply With Quote
 
=?Utf-8?B?VG9tIE9naWx2eQ==?=
Guest
Posts: n/a
 
      22nd Nov 2006
Dates are stored as

In Excel cells,
Number of days since 0 Jan 1900.fraction of a day(i.e. time)

so just do

dim dt as Date, dt1 as Date
dt = Int(myval)
dt1 = Int(myval1)
if dt = dt1 then
' they are the same day

truncating the decimal value gives you just the date (removes the time)

VBA is compatible, but of course supports dates before 1900 (negative
numbers) and doesn't see 1900 as a leap year. So dates after Feb 28, 1900
will be the same.

--
Regards,
Tom Ogilvy


"madeleine" wrote:

> Aha Tom thanks.
>
> What I was trying to do was get rid of the time aspect from a date,
> such that I could compare two dates without having to worry about
> whether it was at 8 in the morning or midday. Is this something that
> you think vbShortDate could help with?
>
> Thanks again
>
> Madeleine
> Tom Ogilvy wrote:
> > from the object browser in the VBE
> >
> > Const vbShortDate = 2
> > Member of VBA.VbDateTimeFormat
> >
> > so it is a member of the VBA type library.
> >
> > However, it is a constant, not a data type, I don't see how you could
> > declare something as type vbShortDate. You would declare it as date and
> > format it as vbshortdate.
> >
> > --
> > Regards,
> > Tom Ogilvy
> >
> >
> > "madeleine" wrote:
> >
> > > Hi
> > >
> > > I'm hoping that someone can help me on this, I'm sure I must be going
> > > mad, I'm trying to declare something as VbShortDate, I get told that I
> > > need to include its type library, I can't actually find out what type
> > > library it lives in.
> > >
> > > Hopefully someone can tell me what box to tick in the references menu.
> > >
> > > All help much appreciated.
> > >
> > > Thanks
> > >
> > > Madeleine
> > >
> > >

>
>

 
Reply With Quote
 
madeleine
Guest
Posts: n/a
 
      24th Nov 2006
Tom

Most excellent thank you very very much.

Regards

Madeleine
Tom Ogilvy wrote:

> Dates are stored as
>
> In Excel cells,
> Number of days since 0 Jan 1900.fraction of a day(i.e. time)
>
> so just do
>
> dim dt as Date, dt1 as Date
> dt = Int(myval)
> dt1 = Int(myval1)
> if dt = dt1 then
> ' they are the same day
>
> truncating the decimal value gives you just the date (removes the time)
>
> VBA is compatible, but of course supports dates before 1900 (negative
> numbers) and doesn't see 1900 as a leap year. So dates after Feb 28, 1900
> will be the same.
>
> --
> Regards,
> Tom Ogilvy
>
>
> "madeleine" wrote:
>
> > Aha Tom thanks.
> >
> > What I was trying to do was get rid of the time aspect from a date,
> > such that I could compare two dates without having to worry about
> > whether it was at 8 in the morning or midday. Is this something that
> > you think vbShortDate could help with?
> >
> > Thanks again
> >
> > Madeleine
> > Tom Ogilvy wrote:
> > > from the object browser in the VBE
> > >
> > > Const vbShortDate = 2
> > > Member of VBA.VbDateTimeFormat
> > >
> > > so it is a member of the VBA type library.
> > >
> > > However, it is a constant, not a data type, I don't see how you could
> > > declare something as type vbShortDate. You would declare it as date and
> > > format it as vbshortdate.
> > >
> > > --
> > > Regards,
> > > Tom Ogilvy
> > >
> > >
> > > "madeleine" wrote:
> > >
> > > > Hi
> > > >
> > > > I'm hoping that someone can help me on this, I'm sure I must be going
> > > > mad, I'm trying to declare something as VbShortDate, I get told that I
> > > > need to include its type library, I can't actually find out what type
> > > > library it lives in.
> > > >
> > > > Hopefully someone can tell me what box to tick in the references menu.
> > > >
> > > > All help much appreciated.
> > > >
> > > > Thanks
> > > >
> > > > Madeleine
> > > >
> > > >

> >
> >


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Text type date change to date type date Chrissy Microsoft Access 2 28th Apr 2009 06:17 PM
Warning: Type library exporter could not find the type library for =?Utf-8?B?SnVhbiBEZW50?= Microsoft Dot NET Framework 1 26th Aug 2005 08:10 AM
COM Interop registration failed. Type library exporter can not load required library MSCOREE.TLB. Janus Kamp Hansen Microsoft Dot NET 0 5th Jul 2005 08:01 AM
COM Interop registration failed. Type library exporter can not load required library MSCOREE.TLB. Janus Kamp Hansen Microsoft C# .NET 0 5th Jul 2005 08:01 AM
Re: Visual Library C++ Runtime Library Error When I open Word and attempt to type Cindy Meister -WordMVP- Microsoft Word New Users 0 8th Jul 2003 03:40 PM


Features
 

Advertising
 

Newsgroups
 


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