Forum Discussion
fyi: PowerBuilder app.
Script generated from Keyword Test [below]
The execution stops with Exception
Type Mismatch on the End Date step.
Note: I inserted line breaks in front of FNUD03110.... so code would not wrap
script:
' Enter the Bgn Date [mmddyyyy as text]
Call
Aliases.options.wndFNWND3110.MDIClient.wndFNWND311016.PBTabControl32_100.
FNUDO3110.pbdw110.PBEDIT110.Keys(Project.Variables.LtcTest1.Value("SrvcBgnDt"))
' Tab to next control
Call
Aliases.options.wndFNWND3110.MDIClient.wndFNWND311016.PBTabControl32_100.
FNUDO3110.pbdw110.PBEDIT110.Keys("[Tab]")
' This is where Exception gets thrown when End Date in XLS is blank
' Enter the End Date [mmddyyyy as text]
Call
Aliases.options.wndFNWND3110.MDIClient.wndFNWND311016.PBTabControl32_100.
FNUDO3110.pbdw110.PBEDIT1102.Keys(Project.Variables.LtcTest1.Value("SrvcEndDt"))
' Tab to next control
Call
Aliases.options.wndFNWND3110.MDIClient.wndFNWND311016.PBTabControl32_100.
FNUDO3110.pbdw110.PBEDIT1102.Keys("[Tab]")
- BillA60311 years agoContributor
Data:
row 1 and row 3 run fine.
row 2 test fails [blank end date].
SrvcBgnDt | SrvcEndDt
-----------| ----------
01012015 | 03312015
01152015 |
02022015 | 05312015
- Marsha_R11 years ago
Champion Level 3
Blank fields in Excel have never worked for us, no matter how we formatted the field. I suspect that there's hidden formatting that causes the type mismatch.
What we ended up doing was putting some never-to-be-used character in the "empty" field and then using If Then Else
If (ThingInExcel) does not equal (SpecialCharacter) Then
(put ThingInExcel in field)
Else
(tab past field)
- Andrey_M11 years agoContributor
Hi Marsha.
Have you tried nothing for empty field check?
In KDT it looks like
If Variables.excelData("Field2") Equals nothing
Log Message [...]
To define nothing in KDT: select Code Expression as value type to compare to and type nothing as piece of code.
This example is valid if VBS was chosen as scripting language.
null works for empty Excel fields if JS used for scripting.