Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

Report Builder and VBA - DisplayAlerts

Avatar

Level 1

Hi,

I'm using rather complex VBA code to open a Workbook, alter data and copy&paste content between diffrent Workbooks, containing RB requests.

I have all Excel warning dialogues disabled using "Application.DisplayAlerts = False". However, Report Builder keeps asking if I want to save changes as soon as my codes tries to close the Workbook containig the RB requests.

Is it possible to disable all RB warnings? Or at least a way to disable RB via VBA for specific Workbooks?

 

Thanks in advance,

Florian Vieth

1 Accepted Solution

Avatar

Correct answer by
Level 5

Hi

Try using

ThisWorkbook.Saved = True

        Application.DisplayAlerts = False
        currentBook.SaveAs Filename:=fileNameS, FileFormat:=xlCSV, ConflictResolution:=xlLocalSessionChanges
        currentBook.Saved = True            
        currentBook.Close SaveChanges:=False
        Application.DisplayAlerts = True

Concept is to auto-save sheets before closing

Regards

Devinder

View solution in original post

0 Replies

Avatar

Correct answer by
Level 5

Hi

Try using

ThisWorkbook.Saved = True

        Application.DisplayAlerts = False
        currentBook.SaveAs Filename:=fileNameS, FileFormat:=xlCSV, ConflictResolution:=xlLocalSessionChanges
        currentBook.Saved = True            
        currentBook.Close SaveChanges:=False
        Application.DisplayAlerts = True

Concept is to auto-save sheets before closing

Regards

Devinder