Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

NiceLabel VBscript to make label print output

Status
Not open for further replies.

Cemmac

Systems Engineer
Apr 6, 2020
1
SI
Hello,

We use NiceLabel software for our production/shipping department. Our label fields are taken from SQL table or programmed with VBScript. I have some special assignment now.
I have one table TWeek (Week in a year of production) TYear(year of production). So like 15W-2020Y.

I would like to program formula to convert this table dataWeek and Year to date DD.MM.YYYY
I have found these 2 options in VBScript, but i can't run it. Object required: 'Wscript'

»
Dim year: year = 2016
Dim wn: wn = 45
Dim wd: wd = DateAdd("ww", wn, DateSerial(year,1,1))
WScript.Echo wd - WeekDay(wd, vbMonday) + 1
«

and other option:

»
Function DateYWkWd(year, wn, wd)
' returns date based von VbMondeay and vbFirstFourDays

Jan4 = Dateserial(year,1,4) ' garantied to be in first week
DateYWkWd = DateAdd("ww",wn-1, DateAdd("d",wd-Weekday(Jan4,2),Jan4))
end Function
«


Thank you for help,

Br,
Andrei


 
Nicelabel hosts Vbscript (well, it's own version, which differs a bit from Microsoft's) itself, does not use wscript (or cscript), so just use echo rather than wscript.echo
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top