Sometimes this gives a procedure error - why?

Below is a .Initialize procedure for a file that allows importing of another file. If the users doesn’t select a file to import (i.e. pushes Cancel), this file closes.

Occasionally, when double clicking this file to both launch Panorama6 and the file itself, I get a message saying there is a procedure error. In those cases, the OpenFile window never comes up. I can see the error message once, then close and reopen the file 10 times and never get that error message again.

Whats going in is there is a Master file and this ViewOnly file. The Initialize routine is in the ViewOnly so it imports the master for viewing. It’s been reported that when the Procedure Error message appears, the master is flagged Open so it cannot be opened by another user with another Panorama until the ViewOnly closes. That is, it’s reported that when the Procedure error occurs, the Master File (selected previously because the OpenFile window never appears) is held hostage.

I haven’t seen that happen, a user report and maybe they are opening the Master instead of the ViewOnly and importing. But I have seen that procedure error. But it doesn’t appear every time. Strange, very strange.

.Initialize procedure:

fileglobal srchstockno, srchmaker, srchmodel, srchcomments, srchstatus
fileglobal orand
fileglobal photopath

//name of folder that holds photos
photopath = “photo”

//add path from current folder to jpgs
photopath = “:” + photopath + “:”

orand = "OR"
srchstockno = ""
srchmaker = ""
srchmodel = ""
srchcomments = ""
srchstatus = “”

//Form needs this or flash art sometimes displays error
showvariables photopath

local folder, file, type
OpenFileDialog folder, file, type, ""
IF file = ""

Openfile “&&” + folderpath(folder) + file

You’ve provided a lot of information, but one potentially missing piece is what the error message actually is, as opposed to saying there is a generic “procedure error”. Sometimes the error message isn’t helpful, but it often is, and it might be a useful clue here.

Well, that’s about what it says. “This procedure (not named) contains and error.” - something very close to that. It does not give and indication of what that error is. It is generated from Panorama or someplace else. I don’t have any If Error trapping. Because it occurs as the file opens, before that openfile command in the procedure appears, I’m assuming it is in the .Initialize file.

I’ve seen it, so I know it exists, but I’ve been launching and launching and can’t get it to reappear repeatedly.

The user, however, seems to indicate he sees it all the time. I have email to him asking him to verify that and also see if it makes any difference if Panorama is already launched before the file with the .initialize is opened.