PDA

View Full Version : [SOLVED:] Is a refresh or update command needed?



groston
11-13-2025, 01:20 PM
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.

Aussiebear
11-13-2025, 05:09 PM
Any chance we can see your code?

groston
11-13-2025, 09:29 PM
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.