Consulting

Page 6 of 6 FirstFirst ... 4 5 6
Results 101 to 117 of 117

Thread: Challenge!! Can you solve this problem?

  1. #101
    Moderator VBAX Master Tommy's Avatar
    Joined
    May 2004
    Location
    Houston, TX
    Posts
    1,184
    Location
    LOL I commented out the AutoClose macro because I saw one similar that PDF had installed. I also ran the test case for the PDFmaker and you are correct the error showed up.


    Originally Posted by Howard Kaikow

    This duplicate toolbar problem appears to have been caused by some design change made in Word 2000 that persists thru Word 2002 and Word 2003
    As I posted earlier this may be MS's way of preventing the spread of viruses. I do know that in Excel you cannot add a macro to a newly created sheet (via a macro/code) until it is saved, as MD as suggested, and johnske has suggested it is the same for Word. The thing is this all can be done in the VBIDE with no problem by "hand", so I feel that, taking it a step further, the problems involed with the commandbars is an intentional henderace to convince coders to supply templates with the commandbars instead of changing the normal.dot.


    Why? Because no good coder worth their salt will release something that they know is wrong.


    The error occurs when Word is shutdown after all docs are closed.

  2. #102
    VBAX Mentor
    Joined
    Sep 2004
    Location
    Nashua, NH, USA
    Posts
    489
    Location
    Quote Originally Posted by Tommy
    LOL I commented out the AutoClose macro because I saw one similar that PDF had installed.
    .

    That was not a problem. Each and every template may have an AutoClose.
    They do no harm by themselves.

    A problem occurs if a sloppily written 3rd party critter such as PDFMaker lurks in the background and affects other things, sometimes in very subtle ways.

    Another example. A few months ago, I decided to try a template from a well known organization. Each time, Word told me that I had changes to Normal.dot when I knew I did not. Normally, one can avoid such problems by using proper defenses in one's own Auto macros and document events. However, in that case, the template did something naughty in their document_close event which occurs AFTER my own stuff runs.

    I was able to determine this because I knew how to look at the password protected code. As I am well connected with the owner of the code, they pointed me to the programmer and I pointed out the problem (and two alternative solutions). The programmer stated that he was aware of the problem and thought that he had prevented the problem. I pointed out to him WHY he missed it.

    Many 3rd parties release Office code with just such problems.

    I also ran the test case for the PDFmaker and you are correct the error showed up.
    PDFMaker is to be polite @$$#@%$!!.


    As I posted earlier this may be MS's way of preventing the spread of viruses. I do know that in Excel you cannot add a macro to a newly created sheet (via a macro/code) until it is saved, as MD as suggested, and johnske has suggested it is the same for Word. The thing is this all can be done in the VBIDE with no problem by "hand", so I feel that, taking it a step further, the problems involed with the commandbars is an intentional henderace to convince coders to supply templates with the commandbars instead of changing the normal.dot.
    Not all true, but I'll not dwell on this now.


    Why? Because no good coder worth their salt will release something that they know is wrong.
    Sometimes the powers that be force code to be released even tho advised by the programmers or quality assurance folkes that the code is not ready. That's just unfortunately the way the world is (mis)run.

    The error occurs when Word is shutdown after all docs are closed.
    But not right after the template is closed?

    Word is obviously confused as demonstrated by the duplicate toolbar issue. So whatever is causing that confusion is exacerbating some other problem with some other 3rd party app.

  3. #103
    Moderator VBAX Master Tommy's Avatar
    Joined
    May 2004
    Location
    Houston, TX
    Posts
    1,184
    Location
    But not right after the template is closed?

    Word is obviously confused as demonstrated by the duplicate toolbar issue. So whatever is causing that confusion is exacerbating some other problem with some other 3rd party app.
    Just to present the steps:

    I had the VBIDE open, I picked the X in the upper right hand corner, the template closed and normal was highlighed when the dialog box poped up. Also noted was the PDFmaker was still in the project which implies that it was not closed yet and normal was either in the process of closing and didn't due to error or the error occured before Normal was told to close.

    I can open a document, open the template, run macros, close template, close doc, close Word, then get error.

    On a another note, Word keeps track of the buttons that are added by using the .Tag property, even though when you loop through the "Standard" buttons the .Tag properties are blank. I read that somewhere so don't hold me to that.

  4. #104
    VBAX Mentor
    Joined
    Sep 2004
    Location
    Nashua, NH, USA
    Posts
    489
    Location
    Dag nab it!
    I had just finished replying and lost my phone connection and lost what I typed. Oh well, maybe I'll get better words this time.


    Quote Originally Posted by Tommy
    Just to present the steps:

    I had the VBIDE open, I picked the X in the upper right hand corner, the template closed
    There is no need to open the VBIDE. The macro should be run using the "Test Toolbar" or via the Tools |acros menu in Word.

    and normal was highlighed when the dialog box poped up.
    What dialog box?

    Also noted was the PDFmaker was still in the project which implies that it was not closed yet and normal was either in the process of closing and didn't due to error or the error occured before Normal was told to close.
    PDFMaker is not going to close until you tell Word to close and it will difficult, if not impossible, to see the sequence of closing.


    I can open a document, open the template, run macros, close template, close doc, close Word, then get error.
    Good, that confirms my assertion in my previous posting.

    On a another note, Word keeps track of the buttons that are added by using the .Tag property, even though when you loop through the "Standard" buttons the .Tag properties are blank. I read that somewhere so don't hold me to that.
    The ID property identifies the buttons. The Tag property is not used by Word, rather it is reserved for the app to use in any which way including loose.

  5. #105
    Moderator VBAX Master Tommy's Avatar
    Joined
    May 2004
    Location
    Houston, TX
    Posts
    1,184
    Location
    What dialog box?
    The one that displays the error. I had the VBIDE open to see if I could track the error down.

  6. #106
    VBAX Mentor
    Joined
    Sep 2004
    Location
    Nashua, NH, USA
    Posts
    489
    Location
    Quote Originally Posted by Tommy
    The one that displays the error. I had the VBIDE open to see if I could track the error down.
    Such errors are, in effect, impossible/impractical to track.
    They get buried very deeply in interactions among different pieces of software.

  7. #107
    Administrator
    Chat VP
    VBAX Guru johnske's Avatar
    Joined
    Jul 2004
    Location
    Townsville, Australia
    Posts
    2,872
    Location
    Quote Originally Posted by Tommy
    As I posted earlier this may be MS's way of preventing the spread of viruses. I do know that in Excel you cannot add a macro to a newly created sheet (via a macro/code) until it is saved, as MD as suggested, and johnske has suggested it is the same for Word.....(etc)
    Indeed tommy, if one plays around with the following subs you will see that once the VBE window is opened (state 2 as far as I'm aware), you can exit from the VBE window, run the macro "IsVBEWindowOpen" and find that it's still open....It remains open (though certainly not visible) until after you completely QUIT (not just save) the application.

    [VBA]
    Sub OpenVBEwindow_ByVisible()
    Application.VBE.MainWindow.Visible = True
    End Sub

    Sub OpenVBEwindow_ByState()
    Application.VBE.MainWindow.WindowState = 2
    End Sub

    Sub IsVBEwindowOpen()
    If Application.VBE.MainWindow.WindowState = 2 Then MsgBox "VBE window is open (State 2)"
    End Sub
    [/VBA]

  8. #108
    VBAX Mentor
    Joined
    Sep 2004
    Location
    Nashua, NH, USA
    Posts
    489
    Location
    Quote Originally Posted by johnske
    Indeed tommy, if one plays around with the following subs you will see that once the VBE window is opened (state 2 as far as I'm aware), you can exit from the VBE window, run the macro "IsVBEWindowOpen" and find that it's still open....It remains open (though certainly not visible) until after you completely QUIT (not just save) the application.

    [VBA]
    Sub OpenVBEwindow_ByVisible()
    Application.VBE.MainWindow.Visible = True
    End Sub

    Sub OpenVBEwindow_ByState()
    Application.VBE.MainWindow.WindowState = 2
    End Sub

    Sub IsVBEwindowOpen()
    If Application.VBE.MainWindow.WindowState = 2
    Then MsgBox "VBE window is open (State 2)"
    End Sub
    [/VBA]
    See http://www.vbaexpress.com/forum/show...=9046#post9046.

  9. #109
    VBAX Mentor
    Joined
    Sep 2004
    Location
    Nashua, NH, USA
    Posts
    489
    Location
    Quote Originally Posted by Howard Kaikow
    .

    PDFMaker is to be polite @$$#@%$!!.
    Hmmm, perhaps I should have used the real words to test the forum's censorship?

    Oh, h,e, double hockey sticks!

  10. #110
    VBAX Mentor
    Joined
    Sep 2004
    Location
    Nashua, NH, USA
    Posts
    489
    Location
    The failure to delete toolbar problem is quite consistent.

    I created a totally different template to create 2 identically named toolbars.
    Again, they were not deleted, and after running the nacro twice, I ended up with 4 identically named toolbars.

    At least the behaviors is consistent.

  11. #111
    Moderator VBAX Master Tommy's Avatar
    Joined
    May 2004
    Location
    Houston, TX
    Posts
    1,184
    Location
    I stiil get the error 5852. I will look into further later today. I think I am going to code it from scratch to see if I can find a way around or through it.

  12. #112
    VBAX Mentor
    Joined
    Sep 2004
    Location
    Nashua, NH, USA
    Posts
    489
    Location
    Quote Originally Posted by Tommy
    I stiil get the error 5852. I will look into further later today. I think I am going to code it from scratch to see if I can find a way around or through it.
    did you use the template I sent only to you?

    I'll send you another one that was coded from scratch and does not have a toolbar.

  13. #113
    VBAX Mentor
    Joined
    Sep 2004
    Location
    Nashua, NH, USA
    Posts
    489
    Location
    Quote Originally Posted by Dreamboat
    Here's a simpler URL (requires Javascript be enabled).
    http://www.standards.com/links.html?FailureToDeleteToolbar

  14. #114
    Administrator
    Chat VP VBAX Guru johnske's Avatar
    Joined
    Jul 2004
    Location
    Townsville, Australia
    Posts
    2,872
    Location
    Have you read this? > http://support.microsoft.com/default...b;en-us;241652 - seems a very similar problem...

    As it appears the problem was discovered in Excel, the whole thing refers to Excel in particular. But I cant see the methods for working around it in Excel differing from those for Word by very much.

    It not only discusses ways to work around the problem, it also has a link to a downloadable registry repair tool to fix the problem.

    Note: I started to install the fix to test to see if this also applies to Word, but as the downloadable installation was about a three-hour one I simply couldn't be bothered - I'll work around it...

  15. #115
    VBAX Mentor
    Joined
    Sep 2004
    Location
    Nashua, NH, USA
    Posts
    489
    Location
    Quote Originally Posted by johnske
    Have you read this? > http://support.microsoft.com/default...b;en-us;241652 - seems a very similar problem...

    As it appears the problem was discovered in Excel, the whole thing refers to Excel in particular. But I cant see the methods for working around it in Excel differing from those for Word by very much.

    It not only discusses ways to work around the problem, it also has a link to a downloadable registry repair tool to fix the problem.

    Note: I started to install the fix to test to see if this also applies to Word, but as the downloadable installation was about a three-hour one I simply couldn't be bothered - I'll work around it...
    Yes, I saw that in May 2003, but had forgotten about it.

    Seems like it may be more related to http://www.standards.com/links.html?SetReferenceInWordProject. However, if discussed here, has to be a separate thread.

  16. #116
    VBAX Mentor
    Joined
    Sep 2004
    Location
    Nashua, NH, USA
    Posts
    489
    Location
    Quote Originally Posted by johnske
    Have you read this? > http://support.microsoft.com/default...b;en-us;241652 - seems a very similar problem...

    As it appears the problem was discovered in Excel, the whole thing refers to Excel in particular. But I cant see the methods for working around it in Excel differing from those for Word by very much.

    It not only discusses ways to work around the problem, it also has a link to a downloadable registry repair tool to fix the problem.

    Note: I started to install the fix to test to see if this also applies to Word, but as the downloadable installation was about a three-hour one I simply couldn't be bothered - I'll work around it...
    First, you really do need to keep each Office version up tp date. Not only are there bugs fixed, but there are security issues. Just start the download and partake of you rfavorite hobby, or read, or which TV while the critter does its thing.

    In any case, as I already had the patched Office 2000, I could not reproduce the problem in the KB article in Excel 2000, so, always looking for trouble, I booted to my system with Office 97, and was able to reproduce the problem.

    Excel handles CommandBars in certain ways that are very different than Word. And Word 97 does have that problem anyway.

    Applying the Excel workaround to Word to see whether it avoids the delete toolbar issue I raised would be a bit more complex than the way the technique is applied in Excel.

    Actually, the technique might be more appropriate to the problem in http://www.standards.com/links.html?SetReferenceInWordProject.
    If only for the latter reason, I'll try to apply the technique, but not before tomorrow (hmmm, it's just about tomorrow down under, n'est-ce pas, so I mean tomorrow in USA Eastern time zone).

  17. #117
    VBAX Mentor
    Joined
    Sep 2004
    Location
    Nashua, NH, USA
    Posts
    489
    Location
    Quote Originally Posted by Howard Kaikow
    Excel handles CommandBars in certain ways that are very different than Word. And Word 97 does have that problem anyway.
    I meant to say "Word 97 does NOT have that problem anyway".

    Applying the Excel workaround to Word to see whether it avoids the delete toolbar issue I raised would be a bit more complex than the way the technique is applied in Excel.
    I made a first attempt at applying the technique with Word.
    The technique, as I applied it, just further exacerbates the delete toolbar issue in Word.

    Actually, the technique might be more appropriate to the problem in http://www.standards.com/links.html?SetReferenceInWordProject.
    I've not yet tried this.

Posting Permissions

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