Results 1 to 2 of 2

Thread: Keybindings causing errors

  1. #1

    Thread Starter
    New Member
    Join Date
    Jul 2003
    Posts
    2

    Keybindings causing errors

    Please tell me that someone has had this before and found a way around it.
    Our main template that goes in the Startup folder for Word is a bit of a monster, lots of stuff happening on AutoExec and in document and application events.
    A whole chunk of this code relates to one part of the firm, so I whipped it out into another template. Since I did this I've had a run-time error when I go into Word

    4248: This command is not available because no document is open

    Well, after a lot of commenting, saving, opening, (repeat). I tracked it down to KeyBindings. Any time I do something with Keybindings I get that message on starting Word.

    I don't get it. KeyBindings is an Application collection!
    If it ain't broke....it doesn't conform to Microsoft Coding Standards

  2. #2
    Fanatic Member Matt_T_hat's Avatar
    Join Date
    Dec 2001
    Location
    '76 Male Body Evil-Errors: 666
    Posts
    774
    you get error 4248 which if memory searves means that you tried to do something to a document while it was closed or before it finnished opening.

    Try moveing you code into a module and calling it from within the documents code that should fix it.

    Sounds like you may need to use a full VB application to handle the document stuff. Create a VB Project and you should be able to call it from the VBa Code (I assume that this is work related and so if you do not have VB6 get them to shell out for it).

    Sorry I don't have a diffinative answer but it really sounds like you've reached the end of the VBa and need to progress to Level 2 as it were.
    ?
    'What's this bit for anyway?
    For Jono

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width