Consulting

Results 1 to 3 of 3

Thread: Is a refresh or update command needed?

  1. #1
    VBAX Regular
    Joined
    Aug 2010
    Posts
    10
    Location

    Question Is a refresh or update command needed?

    I have a macro that creates a new workbook and adds data. Once a certain number of rows have been added, a new sheet is created and the new data goes there.

    Here's what's odd: When I put a break point in the code where the new sheet is created, the program runs exactly as expected (the new workbook appears, pages are added, etc). However, if I remove the break point, nothing appears to happen and the new workbook is not saved (one of the lines in the macro).

    It feels like I need to add a line of code to make the new workbook appear or something like that. Please point me in the right direction.

    --update

    Just did some reading and found the RefreshAll. command. I added this to the code after the data is entered and the first sheet of the new workbook appeared. But when the second sheet was added/filled, the workbook did not change.

  2. #2
    Moderator VBAX Wizard Aussiebear's Avatar
    Joined
    Dec 2005
    Location
    Queensland
    Posts
    5,512
    Location
    Any chance we can see your code?
    Remember To Do the Following....
    Use [Code].... [/Code] tags when posting code to the thread.
    Mark your thread as Solved if satisfied by using the Thread Tools options.
    If posting the same issue to another forum please show the link

  3. #3
    VBAX Regular
    Joined
    Aug 2010
    Posts
    10
    Location
    Aussiebear - I decided to clean up the code before sharing it and the one HUGE change I made was to have the new sheets appear after the existing sheets. Anyway, this seems to have addressed the problem - not sure why, but the code appears to be working. Thanks.

    A did another test and it didn't work, so I was going to upload the code. But some more digging showed that the error was someplace completed unrelated because an array, which I though was being initialized in Workbook_Open, wasn't getting initialized. Anyway, problem resolved.
    Last edited by groston; 11-13-2025 at 10:40 PM.

Posting Permissions

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