update links in open file method

baha17

Board Regular
Joined
May 12, 2010
Messages
183
Good Day,

I wanted to write a code for the user to open a file in specific destinations and choose excel file among them. then do all necessary copy and paste things. I found a code here and altered a bit for my use. It works fine. But my problem is it kept on displaying update links message. I tried to avoid by using
Code:
UpdateLinks:=0
but could not manage.
Anyone would like to give me a hand?

Thank you very much
Cheers Baha

Code:
Sub OpenFileCopyRange()
Application.DisplayAlerts = False
Application.ScreenUpdating = False


ChDrive "G:"
ChDir "G:\Sales\EOD Reports\Top 20 Daily\"
Set sh = ThisWorkbook.Sheets("T20 SCL")
Set sh2 = ThisWorkbook.Sheets("Sds T20")
Set sh3 = ThisWorkbook.Sheets("Vn T20")
Set sh4 = ThisWorkbook.Sheets("Pla T20")
Set sh5 = ThisWorkbook.Sheets("SC T20")
Set sh6 = ThisWorkbook.Sheets("Par T20")


Filename = Application.GetOpenFilename("Excel files (*.xls*), *.xls*", UpdateLinks:=0, Title:="Please select a file that you would export the report from")
If Filename <> False Then
  Workbooks.Open (Filename)
  Sheets("Top 20").UsedRange.Copy sh.Range("A1:V74")
  Sheets("Snd").UsedRange.Copy sh2.Range("A1:V74")
  Sheets("Ven").UsedRange.Copy sh3.Range("A1:V74")
  Sheets("Plaz").UsedRange.Copy sh4.Range("A1:V74")
  Sheets("SC").UsedRange.Copy sh5.Range("A1:V74")
  Sheets("Par").UsedRange.Copy sh6.Range("A1:V74")
  ActiveWorkbook.Close
Else
 Exit Sub
End If






Application.DisplayAlerts = True
Application.ScreenUpdating = True
End Sub
 
Last edited:

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.

Forum statistics

Threads
1,223,627
Messages
6,173,424
Members
452,515
Latest member
Alicedonald9

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