auto refresh connections wipes clipboard

merlin777

Well-known Member
Joined
Aug 29, 2009
Messages
1,397
Office Version
  1. 2007
I use auto refresh connections, set to every minute. It seems to clear my clipboard so if I copy something and a refresh occurs I can't then paste.

Is there a way around this?
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
You could schedule the macro below to run every minute, see the link on how to do it:

http://www.globaliconnect.com/excel...rvals-or-a-specified-time&catid=79&Itemid=475


Code:
Sub Clip()
Dim dClip As MSForms.DataObject, sClip$, cn As WorkbookConnection


Set dClip = New MSForms.DataObject
dClip.GetFromClipboard                      ' save clipboard
sClip = dClip.GetText
ActiveSheet.Protect
ActiveSheet.Unprotect                       ' wipes clipboard
For Each cn In ActiveWorkbook.Connections
    cn.Refresh
Next
Set dClip = New MSForms.DataObject
dClip.SetText sClip
dClip.PutInClipboard                        ' restore it
[a1].Activate
ActiveSheet.Paste
End Sub
 
Upvote 0
You could schedule the macro below to run every minute, see the link on how to do it:

http://www.globaliconnect.com/excel...rvals-or-a-specified-time&catid=79&Itemid=475


Code:
Sub Clip()
Dim dClip As MSForms.DataObject, sClip$, cn As WorkbookConnection


Set dClip = New MSForms.DataObject
dClip.GetFromClipboard                      ' save clipboard
sClip = dClip.GetText
ActiveSheet.Protect
ActiveSheet.Unprotect                       ' wipes clipboard
For Each cn In ActiveWorkbook.Connections
    cn.Refresh
Next
Set dClip = New MSForms.DataObject
dClip.SetText sClip
dClip.PutInClipboard                        ' restore it
[a1].Activate
ActiveSheet.Paste
End Sub

thanks, mate - i'll give that a try. Do I need to deselect auto refresh too?
 
Upvote 0
Yes, disable auto refresh, as it will be done by the code. That post was just an example, use the version below.

Code:
Sub Clip()
Dim dClip As MSForms.DataObject, sClip$, cn As WorkbookConnection
Set dClip = New MSForms.DataObject
dClip.GetFromClipboard                      ' save clipboard
sClip = dClip.GetText
For Each cn In ActiveWorkbook.Connections   ' stuff that wipes clipboard
    cn.Refresh
Next
Set dClip = New MSForms.DataObject
dClip.SetText sClip
dClip.PutInClipboard                        ' restore the clipboard
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,178
Members
453,021
Latest member
Justyna P

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