Skip to main content

Seemingly unrelated change to dialog is causing FileSystemObject methods to throw internal error

I apologize in advance for the length of my script and the fact that it probably fails to follow a host of best practices in IDEAScript and/or VBScript... I'm pretty new to this, so bear with me :)
 
The part of the script that's relevant is a dialog box that 1) populates a dropdown box with a set of values from an IDEA database field listbox1() and 2) asks the user to select one or more of those values (in series) and then adds them to an array GoodFeedbackValues() that will be used later. Previously I had my code wrong--I didn't realize dlgFeedbackCategories.DropListBox1 would return the integer array index of the selected item, rather than the item/value itself. I updated line 153 from
 
GoodFeedbackValues(0) = dlgFeedbackCategories.DropListBox1
 
to
 
GoodFeedbackValues(0) = listbox1(dlgFeedbackCategories.DropListBox1)
 
and updated line 157 similarly, and suddenly the two instances I have of FileSystemObject.GetFolder are both throwing internal errors (I know both are because I commented out the section that included the first one, and got the same error when I got to the second). The two instances are at line 148 in function checkPrefixUsed() and at line 218 in function getFilesInFolder().
 
I can't imagine how these two things could be related, because my dialog box code doesn't run until after the first FileSystemObject.GetFolder; but it seems to be messing it up all the same. I would love if someone more knowledgeable than me had any suggestions!

rachel.organist Fri, 12/20/2019 - 14:47

Update: I found that dlgFeedbackCategories.DropListBox1 is always returning 0, regardless of which item the user selects. Maybe this is a clue? I looked at the example use case of DropListBox in the IDEA Language Browser and I can't figure out what I'm doing wrong...

Brian Element Mon, 12/23/2019 - 15:47

Hi Rachel,

I just had a quick look at your script and the problem is probably because in your drop list menu item you don't have an array varaible, if you don't have it give strange errors like you are getting.

So remove the following line under the Option Explicit

Dim listbox1() As String and add listbox1$() to the Attached List - see below.

The website encountered an unexpected error. Try again later.