• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 219
  • Last Modified:

Getting %s: %s when extracting data

Hi,

I am running LotusScript code that extracts data from a document and puts in Excel. Problem is it fails when it tries to extract the field names and it pops up with a window with this error: "%s: %s" What does this mean?

Here's a snippet of code below. If I a step through the code, the error pops up at the line where it says, "If x = -1 Then". There's at least 234 fields(items) it is trying to extract..would the no of fields be the problem? Most of the fields have no data.  Thanks.

'Get Field Names that will become column headings
x = -1
Forall i In ndocData.Items
If Left(i.Name, 4) = "xml_" Then
x = x + 1
Redim Preserve itemNames(x)
itemNames(x) = i.Name
End If
End Forall

If x = -1 Then
Msgbox "No data fields found!"
Exit Sub
End If

0
Mero
Asked:
Mero
  • 4
  • 4
  • 2
  • +2
1 Solution
 
snocrossCommented:
When you are stepping through the code and you receive the error, what is the current value of x?
0
 
zvonkoCommented:
Rewrite your checking statement from:
If x = -1 Then
to:
If (x < 0) Then

Also insert for debugging purposes after "xml_" string checking line a found trace, like:
MsgBox "Field: " & i.Name

It is also a good practice to have the setting:
Option Declare
set :-)

Are you programming in Notes.Designer or in Excel VBA?

0
 
ArunkumarCommented:
Listening....
0
The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

 
MeroAuthor Commented:
I'm sorry I have not had a chance to answer your questions or try your suggestions.  I'll try to tommorrow.
0
 
Jean Marie GeeraertsApplication EngineerCommented:
If there are 234 fields to go through, I'd suggest using print "Field: " & i.Name in stead of the message box, unless of course you want to click away a message box 234 times :-)

The debugging info will be available in notes log and in the status bar of the client running the agent.

Regards,
JM
0
 
Jean Marie GeeraertsApplication EngineerCommented:
P.S.: Personally I prefer to write debugging info to an agent log, if you don't know how and want me to tell you, just let me know...
0
 
zvonkoCommented:
Hello Mero,

any progress here?

0
 
zvonkoCommented:
Hello Mero...
0
 
ArunkumarCommented:
Hello Helloo..... !
0
 
Jean Marie GeeraertsApplication EngineerCommented:
Earth to Mero, come in please :-)
0
 
zvonkoCommented:
"Mission Control, we have a problem" :)

0
 
MeroAuthor Commented:
All,

Have not had a chance to even touch this problem..Zvonko and Arunkumar, I am struggling with the CORBA problem I posted..
0
 
Jean Marie GeeraertsApplication EngineerCommented:
Ah, okay :)
0

Featured Post

The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

  • 4
  • 4
  • 2
  • +2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now