Hard one: DateDiffrence ,type mismatch error

H

Hovda

Hi Experts.

Still getting this mismatch error in my msp vba macro.

the problem is:

i want to use the task calendar in the dateDifference function but ge
an error. (Type Mismatch error )

For testing im using "Night Shift"
when using:

MsgBox (Application.DateDifference("10.07.04", "12.07.04", "Nigh
shift"))

this return an type mismatch error.

ive checked the dates and they are okey.

ive found out that it may have something to with the datatype of th
calendar. when i use "24 Hours" (String) as calendar i get this error
but using ActiveProject.Calendar (Object/Calendar) its works fine.

so then i tought okey.... lets use:

dim Activity as Task

MsgBox (Application.DateDifference("10.07.04", "12.07.04"
Activity.Calendar))

but the sad thing is then that Activity.Calendar is a String. So thi
dosent work.

So, what to do? something to change in settings?

it most be someway to refer to the TaskCalendar as an object?

Thank you all for reading this and trying to help me!

- Bjorn, Norwa
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top