Expand my Community achievements bar.

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

1 Reply

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