January 23, 200619 yr The following lines run fine... [color:blue]Dim fmApp Set fmApp = CreateObject( "FMPRO.Application" ) fmApp.Visible = True ...and I get a new instance of FM in the foreground. However, when I try and get the Documents object like this... [color:blue]Dim fmDocs fmDocs = fmApp.Documents ...I get a COM exception error. I have also tried it in VB and it fails at the same point. Any ideas?
January 23, 200619 yr fmDocs = fmApp.Documents ...I get a COM exception error. you need the "set" keyword: "set fmdocs = fmApp.Documents" But I'm assuming this is just a typo because not having the "set" would not generate a COM error. If you reboot the machine does it then work for a while but fails after a couple of runs? I've been seeing similar behaviour in VB.NET and C# lately and haven't been able to find out what could cause this. What's the full text of the error? When you get the error, close FM. Then go to the task manager and look in the list of running processes (second tab, not the running apps) is there still an instance of FM?
January 23, 200619 yr Author Yes, a typo indeed. Today I have restarted both XP machines that this was happening on and tried to get an error message for you. Of course, both now work perfectly every time (about 50 times each so far) from VB, VBScript and REALBasic. I have literally just rebooted and tried again - no changes to the code at all. I will keep playing and see if I can get an error. As far as I remember, it was as if it was saying that the Application object didn't have a property called "Documents". Yet, it would return other properties such as "FullName" just fine. Thanks for your assistance and I'll keep you informed.
January 24, 200619 yr Please do. I'm having irregular success with it too and if there's a bug there I want to track it down. Too much of my business depends on it...
January 26, 200619 yr Author Still no luck with getting it to crash out (if that makes sense!). Working every time. Will keep watching closely. Incidentally, what method (if any) do you use to get round the fact that you can't send a parameter with the DoFMScript method?
January 26, 200619 yr Paste, or go through the FM import engine (a utility script that imports into a global, using the update import option).
Create an account or sign in to comment