Componet name already exist error

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
Mirdurern
Newbie
Posts: 11
Joined: Mon Sep 27, 2004 5:46 pm

Componet name already exist error

Post by Mirdurern » Thu Oct 14, 2004 5:45 pm

Hello,

First, I would like to thank everyone for all of the great help I am getting in this forum.

Today I wanted to repeat my macro so that people did not have to hit F5 each time. I placed a loop if the serial number did not show up in the data base that it ends, but i got an error "A componet name Print already exist" Does anyone know what causes this problem?

Thanks
Mike



Here is a paste of my macro:

Label>MasterLoop

DeleteFile>C:\logFile.txt

VBSTART
GetSSN = right(InputBox("Enter Serial Number : "),10)
Dim SQLString
Dim SSN
set MyDB = CreateObject("ADODB.Connection")
MyDB.Open "shellman"

SQLString = "select initcap(fnameupper) fname, initcap(lnameupper) lname from ear e, journal j, person p where e.journalid = j.journalid and j.personid = p.personid and electronicsserno = '" & GetSSN & "'"
set rsCustomers = MyDB.Execute(SQLString)

If Not rsCustomers.EOF then
SSN = rsCustomers.Fields("fname")
SSN = SSN & " " & rsCustomers.Fields("lname")
Else
SSN = "Found"
End if

MyDB.Close

VBEND
VBEval>SSN,cname
VBEval>GetSSN,name

If>cname=Found,NoName

WriteLn>C:\logFile.txt,%name%
WriteLn>C:\logFile.txt,%name%-1
WriteLn>C:\logFile.txt,%name%-2
ReadLn>C:\logFile.txt,1,SN
ReadLn>C:\logFile.txt,2,SNA
ReadLn>C:\logFile.txt,3,SNB

Let>listpathtech1=\\jupiter\vol2\SLA\3dImages\idnumber\

IfDirExists>listpathtech1,MainLoop
Goto>Final

Label>MainLoop
'Focus on
SetFocus>Microsoft Word*
WaitReady>0

Let>path1=\\jupiter\vol2\SLA\3dImages\
Let>path=DataSheetBack.dot

Press CTRL
Send Character/Text>o
Release CTRL
WaitWindowOpen>Open
Send Character/Text>path
WaitReady>0
Press Enter
Press ALT
Send Character/Text>i
Release ALT
Send Character/Text>P
Send Character/Text>F

Wait>0.5
WaitReady>0
Send Character/Text>SN
Send Character/Text>.jpg
Remark>Press Del
Press Enter
Press ALT
Send Character/Text>s
Release ALT

Press Backspace
Press ALT
Send Character/Text>o
Release ALT

Send Character/Text>i
WaitReady>0
Press CTRL
Press Tab
Press Tab
Press Tab
Release CTRL
Press ALT
Send Character/Text>e
Release ALT
Send Character/Text>2.70
Press Tab
Press Enter
Press Right
Press Tab
Press Left


Press Right
Press Tab
Press Left

Press Enter
Press Enter
Press Enter
Press Enter
Press Enter

Wait>0.7

SetFocus>Microsoft Word*
WaitReady>0
Send Character/Text>This was manufactured for
Send Character/Text>cname

DeleteFile>C:\logFile.txt

Dialog>Print
Caption=Ready to Print
Top=137
Width=225
Left=97
Height=180
Label=Ready to print,16,8
Label=Customer Name: %cname%,16,32
Label=Serial Number: %name%,16,56
Button=Yes,16,96,75,25,1
Button=No,112,96,75,25,3
EndDialog>Print

Show>Print,Result
If>Result=1,Print
Goto>Final

Label>Print
SetFocus>Microsoft Word*
Wait>0.9
Press CTRL
Send Character/Text>p
Release CTRL
Press Enter
wait>0.9
Press CTRL
Send Character/Text>w
Release CTRL
Press Tab
Press Enter

Goto>Final


Label>NoName
MessageModal>Please Call Mike at x2538 - %name%
Goto>MasterFinal

Label>Final
Goto>MasterLoop

Label>MasterFinal
[/img]

User avatar
support
Automation Wizard
Posts: 1450
Joined: Sat Oct 19, 2002 4:38 pm
Location: London
Contact:

Post by support » Thu Oct 14, 2004 9:29 pm

Move Label>MasterLoop to after the vb block. You don't need to keep recreating the vbscript code.
MJT Net Support
[email protected]

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts