Clearing cell contents but keeping the web connection

PC2016

New Member
Joined
Jun 3, 2016
Messages
1
This was posted a few years ago but never resolved. I have a web connection that retrieves data from the company website.
Code:
ActiveWorkbook.Connections("my_Connection").Refresh

Currently this is the code I use to clear, but it also removes the link

Code:
ActiveSheet.QueryTables("Item_BOM.php?rand=1464103285&mitm=[""PARTNO""]") _
    .Delete

I have also tried:
Code:
For Each Cn In ActiveSheet.QueryTables
        Cn.Clear
    Next Cn

After running the link, I copy the information into another worksheet. I need to be able to copy it without the connection or it will not copy and paste. So, copy data only, no query link content.

If I try to run again for the next instance, the link is not there. I have to close, without saving, reopen and hope the link is there. There must be a way to clear the contents but leave the link intact.
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.

Forum statistics

Threads
1,216,125
Messages
6,128,998
Members
449,480
Latest member
yesitisasport

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