Changes to CutCopyMode in V1705+ causes problems with ODBC refresh function

Copper Contributor

Somewhere between V1701 and V1705 a change was made to excel which affects when CutCopyMode is returned back to false.  You can see this using Excel normally if you copy something and see those crawling ants but then press the Delete key.  Previously this would exit the Copy mode, but now it does not.

 

I have a VBA macro that updates some ODBC tables.  Whenever i make use of the ODBCObjects.Refresh function, it will do the refresh and paste everything from the clipboard at the bottom of the ODBC table.  It looks very strange and unexpected.

 

The work around is simply to set Application.CutCopyMode to false before doing this.

This problem could affect other functions as well, but this one was causing our business massive headaches for the last few weeks.

 

2 Replies

Hi @Ross Edwards,

 

Send me that excel file and that macro. I will try to solve it.

I've already solved it. The work around is to clear out the clipboard prior to doing the ODBC refresh command.  Its a single command to a Microsoft Library, thus its impossible to resolve directly.  The command is:

odbcCn.Refresh

where odbcCn is the object ODBCConnection

 

This project is using the Microsoft ActiveX Data Objects 2.8 Library, although i'm fairly certain i've tried a new version without success.  This was a little while ago now.