Turning off Message Boxes on Excel files opened in VB Access

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
 

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
What is it you are actually trying to do?

Why do you need to open the workbooks to get the data from them?
 
Upvote 0
What is it you are actually trying to do?

Why do you need to open the workbooks to get the data from them?
 
Upvote 0
What is it you are actually trying to do?

Why do you need to open the workbooks to get the data from them?

As stated, I am taking a directory of Excel files that have data that I need to load into one of my Access application's tables. I am opening each Excel file/worksheet and assigning various field values to variables and then taking those variables and loading them into my Access table using a INSERT command.

My issue is with the Excel files - that is that they have an msgbox automatically pop up when they are opened.

I am looking for a VBA-programmatic way to eliminate or disable the msgbox popping up in the Excel workbooks.
 
Upvote 0

Forum statistics

Threads
1,214,619
Messages
6,120,550
Members
448,970
Latest member
kennimack

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top