Report Builder and VBA - DisplayAlerts | Community
Skip to main content
October 16, 2015
Solved

Report Builder and VBA - DisplayAlerts

  • October 16, 2015
  • 1 reply
  • 1203 views

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

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by devinderbanga

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

1 reply

devinderbanga
devinderbangaAccepted solution
Level 6
October 16, 2015

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