If a file is not open, or if there’s a typo in the name, SaveAndClose throws up an error message. It can’t be handled procedurally.
SaveandClose "covfefe"
If Error nop EndIf
Of course, the file can be checked first to see if it’s open, but…
Also, if Panorama is running in the background, it can open files but SaveandClose fails on shared files with an error that Field or Variable [asyncTaskInfo] does not exist.
Oops. It’s actually checking to make sure the database is open, but it wasn’t returning the error properly.
This is only if the file is opened without windows, right?
Thanks to your amazingly specific report, I think I have been able to find and fix this. However, now I have to figure out how to get it to do it in the background to test the fix. I think setting that up might be as much work as finding the bug…
Ok, that’s not what I expected. Well, I tested my fixed version with both visible and no visible windows, it seems to work either way. However, I never did actually duplicate the problem, so you should verify the fix after the next version is released.
By the way, I think this problem was not specific to saveandclose, but would have occurred with any attempt to close a shared database with Panorama not being the frontmost application.