DG Posted January 23, 2006 Posted January 23, 2006 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?
Wim Decorte Posted January 23, 2006 Posted January 23, 2006 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?
DG Posted January 23, 2006 Author Posted January 23, 2006 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.
Wim Decorte Posted January 24, 2006 Posted January 24, 2006 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...
DG Posted January 26, 2006 Author Posted January 26, 2006 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?
Wim Decorte Posted January 26, 2006 Posted January 26, 2006 Paste, or go through the FM import engine (a utility script that imports into a global, using the update import option).
Recommended Posts
This topic is 6919 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now