1
I am working now with vba, however it is a language that I had little contact in graduation, I would like to ask a question.
When a macro in an excel file calls another excel file that also has macro that was closed does not occur any error, but you try to run a macro with another open occurs an error, example:
excel file "A" runs and calls "B", ends the execution as predicted until the end of the process, but when running the same "A" leaving the "B" or any other macro open (even if not running) an error occurs.
Another question I have is with the DisplayAlerts
, it by default is true
and when false
does not display the messages, responding in a standard way those that need to answer, but as I call this method inside excel vba?
I’ve tried to use Application.DisplayAlerts = False
, I’ve tried to take the object I’m working on and put "obj".DisplayAlerts = False
, however the alerts
keep running, how to solve this?
As is the code that calls the B file, usually you need to reference what you are calling if no errors can occur. What kind of alerts occur? See this code
Application.EnableEvents = False
andApplication.ScreenUpdating = False
– danieltakeshi
It is calling by placing the file inside an object that receives a reference type. When I try to call this object, for example:
Dim objExcel
Set objExcel = CreateObject("Excel.Application"
objExcel.Application.Visible = False objExcel.Application.Run "Planilha.xlsm"
– user111413
The Displayalerts only deletes warnings and messages from Excel Application. If the warning is a VBA program error, this is not deleted by Displayalerts. And please insert the code with the example of the error of executing codes in different workbooks.
– danieltakeshi