+ Reply to Thread
Results 1 to 4 of 4

Code to create Header not always working

  1. #1
    Registered User
    Join Date
    11-20-2012
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    3

    Code to create Header not always working

    I have the following code, which works well when saving a file. However, the code is not working when saveas is used.

    I am new to coding and need to know what can be added to make this work with either save or saveas.

    Please Login or Register  to view this content.
    Thanks is advance to anyone who can offer assistance.

    EDIT:
    Is there a way to use code to force a save immediately after a saveas (without creating a never ending loop)? This may be a work around that would fix this particular issue.

    EDIT 2:
    I have temporarily added code to add a msgbox after the save event as a temporary warning to users. I would still prefer to have a resolution to this issue rather than a warning.
    Last edited by summit73; 11-30-2012 at 05:06 PM. Reason: Had a thought on what might solve my issue.

  2. #2
    Forum Contributor
    Join Date
    10-08-2010
    Location
    Texas
    MS-Off Ver
    Excel 2010
    Posts
    386

    Re: Code to create Header not always working

    When you use save as, your macro runs, but is based on the old work book name. You could just hit save again after doing save as to work around this.

  3. #3
    Registered User
    Join Date
    11-20-2012
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Code to create Header not always working

    I had already noticed this work around. The problem is that this workbook will be used by others in the office that may not remember to hit save again after the saveas action.

    If possible, I need the code to run with either action and not require the extra save after a saveas. (Confusing much?)

  4. #4
    Registered User
    Join Date
    11-20-2012
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Code to create Header not always working

    For those searching the site for answers, I never got the solution that I was hoping for. However, I did make my excel file work the way that I wanted by using the same code with several different events.

    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1