ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   DateTime datatype in VBA (https://www.excelbanter.com/excel-programming/382232-datetime-datatype-vba.html)

ALEX

DateTime datatype in VBA
 
Hello.

When i am trying to use DateTime Datatype in my VBA macro, it gives me
"Automation type not supported by visual basic"

do i have to add some kind of reference to the specific library ? i cannot
find any information on this.

Thank you

Jim Thomlinson

DateTime datatype in VBA
 
Try using just Date. It supports both Date and Time...
--
HTH...

Jim Thomlinson


"Alex" wrote:

Hello.

When i am trying to use DateTime Datatype in my VBA macro, it gives me
"Automation type not supported by visual basic"

do i have to add some kind of reference to the specific library ? i cannot
find any information on this.

Thank you


ALEX

DateTime datatype in VBA
 
Hello Jim.
First of all thank you for responding so quickly.

I am trying to get start/end dates from user in dd-mm-yyyy hh:mm:ss format
and a value in minutes for example 2

then i will make 2 minute sql statements to find out min/max of certain
value over that period of time

so i need to manipulate datetime i couldnt find anything for date datatype
that can be equal to DateTime.AddMinutes

"Jim Thomlinson" wrote:

Try using just Date. It supports both Date and Time...
--
HTH...

Jim Thomlinson


"Alex" wrote:

Hello.

When i am trying to use DateTime Datatype in my VBA macro, it gives me
"Automation type not supported by visual basic"

do i have to add some kind of reference to the specific library ? i cannot
find any information on this.

Thank you


Jim Thomlinson

DateTime datatype in VBA
 
Sorry about taking so long to get back to you (meetings). Try something like
this...

Dim dte As Date

dte = Now()
MsgBox dte

dte = dte + TimeSerial(0, 2, 0)
MsgBox dte

--
HTH...

Jim Thomlinson


"Alex" wrote:

Hello Jim.
First of all thank you for responding so quickly.

I am trying to get start/end dates from user in dd-mm-yyyy hh:mm:ss format
and a value in minutes for example 2

then i will make 2 minute sql statements to find out min/max of certain
value over that period of time

so i need to manipulate datetime i couldnt find anything for date datatype
that can be equal to DateTime.AddMinutes

"Jim Thomlinson" wrote:

Try using just Date. It supports both Date and Time...
--
HTH...

Jim Thomlinson


"Alex" wrote:

Hello.

When i am trying to use DateTime Datatype in my VBA macro, it gives me
"Automation type not supported by visual basic"

do i have to add some kind of reference to the specific library ? i cannot
find any information on this.

Thank you


ALEX

DateTime datatype in VBA
 
Thank you very much. Solved my problem

"Jim Thomlinson" wrote:

Sorry about taking so long to get back to you (meetings). Try something like
this...

Dim dte As Date

dte = Now()
MsgBox dte

dte = dte + TimeSerial(0, 2, 0)
MsgBox dte

--
HTH...

Jim Thomlinson


"Alex" wrote:

Hello Jim.
First of all thank you for responding so quickly.

I am trying to get start/end dates from user in dd-mm-yyyy hh:mm:ss format
and a value in minutes for example 2

then i will make 2 minute sql statements to find out min/max of certain
value over that period of time

so i need to manipulate datetime i couldnt find anything for date datatype
that can be equal to DateTime.AddMinutes

"Jim Thomlinson" wrote:

Try using just Date. It supports both Date and Time...
--
HTH...

Jim Thomlinson


"Alex" wrote:

Hello.

When i am trying to use DateTime Datatype in my VBA macro, it gives me
"Automation type not supported by visual basic"

do i have to add some kind of reference to the specific library ? i cannot
find any information on this.

Thank you



All times are GMT +1. The time now is 09:33 PM.

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