Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

My VBScript won't work in FM8A

Featured Replies

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?

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?

  • 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.

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...

  • 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?

Paste, or go through the FM import engine (a utility script that imports into a global, using the update import option).

  • Author

Ok, import it is. Thanks.

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.