I have to open an excel file in access, but whenever I open that file, I have to choose "OK" on popup msgbox from vba excel.
how to turn off this msgbox automatically ?
I know it is imposible to close modal windows within 1 application. But in my situation, I find a way to do this with my code below.
my Code up-till now:
the code disable event trigger to disable any msgbox appear from on_open event.
set to force disable macro that no macro could run.
then even disable screenupdating or DisplayAlerts, so Excel will completely be opened in silence...
Edit: actually my code work well, but I don't know whether any other situations could happen or not, so plz help me improve it, thank ^^
Edit2: == I think we should move this question to insight section.
how to turn off this msgbox automatically ?
I know it is imposible to close modal windows within 1 application. But in my situation, I find a way to do this with my code below.
my Code up-till now:
Code:
Public Function OpenExcelIdle(strFullFileName As String)
On Error GoTo Err::
Dim xlapp As Object
Set xlapp = CreateObject("Excel.Application")
Dim books As Object
xlapp.EnableEvents = False
xlapp.AutomationSecurity = 3
xlapp.Visible = False
xlapp.DisplayAlerts = False
xlapp.screenupdating = False
xlapp.workbooks.Open (strFullFileName)
Set books = xlapp.ActiveWorkBook
books.Save
books.Close
xlapp.Quit
Exit_F::
Exit Function
Err::
xlapp.DisplayAlerts = True
xlapp.screenupdating = True
xlapp.Quit
Set books = Nothing
Set xlapp = Nothing
Resume Exit_F::
End Function
set to force disable macro that no macro could run.
then even disable screenupdating or DisplayAlerts, so Excel will completely be opened in silence...
Edit: actually my code work well, but I don't know whether any other situations could happen or not, so plz help me improve it, thank ^^
Edit2: == I think we should move this question to insight section.
Comment