Macro to refresh .csv Connection In Workbook - Lose Prompts

Bench

Board Regular
Joined
Aug 27, 2009
Messages
134
Hi,

I'm looking at better ways of importing data from a central spreadsheet into a workbook that drives a dashboard.

I've figured out how to do it, i just need to automate it now.

So far its really simple

Code:
Sub Macro2()
'
' Macro2 Macro
'
'
    Application.DisplayAlerts = False
    ActiveWorkbook.RefreshAll
    Application.DisplayAlerts = True
End Sub

This works but each time i run it i have to click OK in a workbook open style dialogue box to select the file to import, how do i avoid having to click ok each time? I thought the Application.DisplayAlerts = False would resolve this but apparently not.

Any help would be appreciated

Thanks

Ben
 

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand

Forum statistics

Threads
1,223,239
Messages
6,170,947
Members
452,368
Latest member
jayp2104

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