VBA stop pop up asking about links

mattbnorris

New Member
Joined
Sep 17, 2019
Messages
22
Office Version
  1. 2016
Platform
  1. Windows
Hello, the code below is the for loop within my full macro that for loops through a list of directories to open excel sheets, change their database connections, refresh and save. As you can see I’ve added in RemovePersonalInformation, UpdateLinks, DisplayAlerts and AskToUpdateLinks arguments to try and prevent pop ups, but one pop up still persists “We can’t update some of the links in your workbook right now… you can continue without updating their values, or edit the links you think are wrong”. Anyone know how to get rid of this?

VBA Code:
For Each row In prevFpaths

rowPath = row.Value

newPath = Range("V" & R).Value

newPathCheck = VBA.FileSystem.Dir(newPath)

If newPathCheck = VBA.Constants.vbNullString Then

Workbooks.Open rowPath

ActiveWorkbook.RemovePersonalInformation = False

ActiveWorkbook.UpdateLinks = xlUpdateLinksNever

Application.DisplayAlerts = False

Application.AskToUpdateLinks = False

With ActiveWorkbook.Connections("Connection").OLEDBConnection

.BackgroundQuery = False

.CommandText = Array(cubePath)

.Refresh

End With

SaveAs:

ActiveWorkbook.SaveAs Filename:=newPath

ActiveWorkbook.Close

R = R + 1

Else

Workbooks.Open newPath

ActiveWorkbook.RemovePersonalInformation = False

ActiveWorkbook.UpdateLinks = xlUpdateLinksNever

Application.DisplayAlerts = False

Application.AskToUpdateLinks = False

With ActiveWorkbook.Connections("Connection").OLEDBConnection

.BackgroundQuery = False

.CommandText = Array(cubePath)

.Refresh

End With

ActiveWorkbook.Save

ActiveWorkbook.Close

R = R + 1

End If

Next row
VBA Code:
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.

Forum statistics

Threads
1,148,257
Messages
5,745,704
Members
423,968
Latest member
CHHeights

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
Top