View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Gary Keramidas Gary Keramidas is offline
external usenet poster
 
Posts: 2,494
Default Breaking the External Data Link

would this work for you

sub remove()
Dim MyQT As QueryTable
Dim i As Long
Dim j As Long
Dim sheet As Worksheet

For Each sheet In Sheets
i = sheet.Index
For j = Worksheets(i).QueryTables.Count To 1 Step -1
Set MyQT = Worksheets(i).QueryTables(j)
MyQT.Delete
Next
Next
end sub

--


Gary


"Carl" wrote in message
news:iUUzf.9837$jR.9464@fed1read01...
I create reports using an SQL to external data. The report then copies
particular data to division tabs and saves as a separate file. The trouble
is when we open the new spreadsheet there is a link to that External data
and if someone tries to refresh the data, they see my datasource and login.
How do I get rid of the Link to the external data source on the copied
pages?

TIA
Candyman