redshark63
New Member
- Joined
- Jan 13, 2006
- Messages
- 3
Hi.
Wasn't sure whether to post this in the Excel/VBA or the Access folder.
Here is my situation,
I am coding a VBA module in MS Access to retrieve a complete directory of Excel files. Unfortunately, each of the xls files has a macro in it that creates a popup/msgbox which interrupts/hinders the load of the Excel data into my Access DB. I have to click on each msgbox as it pops up in order to get through my load.
Is there a way in VBA to turn off the msgbox macro for each or all of the Excel files?
My Access VBA code so far (partial):
Set f = CurrentDb.OpenRecordset("Folder Maintenance")
sfol = f.incomingfolder ' change to match the source folder path
Set xlApp = CreateObject("Excel.Application")
strFile = Dir(sfol & "*.xls")
xlApp.Displayalerts = False
Do While Len(strFile) > 0
Set wkbCurr = xlApp.Workbooks.Open(sfol & strFile)
Set wksCurr = wkbCurr.Sheets(1)
With wksCurr
...field assignments
EndWith
I tried the Displayalerts = False without success.
Any help is greatly appreciated
Wasn't sure whether to post this in the Excel/VBA or the Access folder.
Here is my situation,
I am coding a VBA module in MS Access to retrieve a complete directory of Excel files. Unfortunately, each of the xls files has a macro in it that creates a popup/msgbox which interrupts/hinders the load of the Excel data into my Access DB. I have to click on each msgbox as it pops up in order to get through my load.
Is there a way in VBA to turn off the msgbox macro for each or all of the Excel files?
My Access VBA code so far (partial):
Set f = CurrentDb.OpenRecordset("Folder Maintenance")
sfol = f.incomingfolder ' change to match the source folder path
Set xlApp = CreateObject("Excel.Application")
strFile = Dir(sfol & "*.xls")
xlApp.Displayalerts = False
Do While Len(strFile) > 0
Set wkbCurr = xlApp.Workbooks.Open(sfol & strFile)
Set wksCurr = wkbCurr.Sheets(1)
With wksCurr
...field assignments
EndWith
I tried the Displayalerts = False without success.
Any help is greatly appreciated