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

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
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,223,893
Messages
6,175,240
Members
452,621
Latest member
Laura_PinksBTHFT

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