Microsoft vbscript runtime error 13 type mismatch

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
koleviko
Junior Coder
Posts: 45
Joined: Thu Nov 20, 2008 2:59 pm

Microsoft vbscript runtime error 13 type mismatch

Post by koleviko » Tue Jan 17, 2012 12:50 am

Code: Select all

VBStart
VBEND

VBEval>DateAdd("d",10,Date),yesterday

VBEval>Year("%yesterday%"),yyyy
VBEval>Month("%yesterday%"),mm
VBEval>Day("%yesterday%"),dd


Message>%yyyy%\%mm%\%dd%

:roll:

User avatar
Marcus Tettmar
Site Admin
Posts: 6988
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Tue Jan 17, 2012 9:04 am

This works fine for me. What line is giving your error?
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

koleviko
Junior Coder
Posts: 45
Joined: Thu Nov 20, 2008 2:59 pm

Post by koleviko » Tue Jan 17, 2012 12:37 pm

Image


Another Question:
Can be built-in tones/ music / inside the exe itself?

User avatar
Marcus Tettmar
Site Admin
Posts: 6988
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Tue Jan 17, 2012 1:21 pm

I don't think VBScript likes your date format.

What do you get if you use native functions instead. Like this:

GetDate>today
DateAdd>today,d,10,another_date
DatePart>another_date,Y,year
DatePart>another_date,M,month
DatePart>another_date,D,day
MessageModal>%year%\%month%\%day%
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

koleviko
Junior Coder
Posts: 45
Joined: Thu Nov 20, 2008 2:59 pm

Post by koleviko » Tue Jan 17, 2012 5:09 pm

The first script works correctly on Windows7.
On windows XP I have stopped services. Maybe give an error for that reason.
:x :x :x


The second script on Windows XP and Windows 7 shows this.

Image


P.S.
Another Question:
Can be built-in tones/ music / inside the exe itself?

User avatar
Marcus Tettmar
Site Admin
Posts: 6988
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Tue Jan 17, 2012 5:14 pm

Which version of Macro Scheduler do you have? The second script I posted requires v13.x
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

koleviko
Junior Coder
Posts: 45
Joined: Thu Nov 20, 2008 2:59 pm

Post by koleviko » Tue Jan 17, 2012 5:34 pm

My version of Macro Scheduler is v11. :?

I will let the terminated services on Windows XP :evil:

User avatar
JRL
Automation Wizard
Posts: 3222
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Post by JRL » Tue Jan 17, 2012 7:40 pm

koleviko,
The code you first posted works for me in versions 11, 12 and 13.

The following gives me the same result in version 11 as what I get in version 11 using your code. What I see in both is 2012\1\27.

Code: Select all

GetDate>yesterday
Add>yesterday,10
Separate>yesterday,/,datepart

MDL>%datepart_3%\%datepart_1%\%datepart_2%
Since Getdate> relies on your system settings to provide a date, a slightly longer but more robust method would be to use the Day> Month> and Year> functions to build your initial date.

Code: Select all

Day>dd
Month>mm
Year>yyyy

Let>Yesterday=%mm%/%dd%/%yyyy%
Add>yesterday,10
Separate>yesterday,/,datepart

MDL>%datepart_3%\%datepart_1%\%datepart_2%

Post Reply