Consulting

Results 1 to 3 of 3

Thread: Wrong VBA reference after save as

  1. #1
    VBAX Regular
    Joined
    Feb 2015
    Posts
    6
    Location

    Exclamation Wrong VBA reference after save as

    Hello,
    I have 3 .dot templates with macros (office 97-03). A costumer is using office 2007 and windows 7.
    - 1st template is a main and it has a form with buttons to open a second .dot template.
    - 2nd template has a form with textareas and radiobuttons etc. to fill the document which has bookmarks and through code it fills this document. When I click a print button it prints this document and calls a 3rd template and closes this document, after 3rd template do its job)
    - 3rd template has to save a document from the 2nd template to a temp folder (wdTempFilePath) and then sends it by outlook.

    All forms has to be modal.

    Problem is that sometimes (about 1 of 50 sent mails) the 3rd template, instead of saving the 2nd template, it saves the 1st, which is completely empty, and then sends this document from the 1st template (according to vba references).

    I would like to know how is it possible and if somebody knows how to solve this issue
    Thank you for any advice.

  2. #2
    VBAX Contributor
    Joined
    Oct 2012
    Location
    Brisbane, Queensland, Australia
    Posts
    163
    Location
    I am not sure why you have the code spread across three templates when it could probably all be in one - most likely the second one that you mention. However, without seeing the code, it is hard, if not impossible to tell you where it is going wrong.

  3. #3
    VBAX Regular
    Joined
    Feb 2015
    Posts
    6
    Location
    Thanks for reply. I understand it is hard to help without code. Unfortunately I cannot post it here
    I don't know why it is like that, I've inherited it. At least the last template is a little bit redundant, so I have to try rewrite the second one(s).

    Maybe I would like to ask: Is it possible to save all opened word documents? Thanks
    Last edited by aamp; 02-26-2015 at 05:05 AM. Reason: New question

Tags for this Thread

Posting Permissions

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