Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
hbj hbj is offline
external usenet poster
 
Posts: 35
Default On-sheet activeX component disables copy/paste

Hi xlgurus,

I have inserted an ActiveX pushbutton to a worksheet, the position of which follows the selected cell. The corresponding VBA code is triggered by event Worksheet_SelectionChange. The purpose is to make it easier to toggle value in a specific column of selected row. By occasion, when I tested it I found that normal Copy/Paste is disabled. This happens at the very line where I set the position of the control:
ActiveSheet.OLEObjects("cmdSetReset").Top = rngAct.Top

Any ideas...

Hakan
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,872
Default On-sheet activeX component disables copy/paste

Hi Hakan,

Am Wed, 2 Jul 2014 07:36:46 -0700 (PDT) schrieb hbj:

ActiveSheet.OLEObjects("cmdSetReset").Top = rngAct.Top


try:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
cmdSetReset.Top = Target.Top
End Sub


Regards
Claus B.
--
Vista Ultimate / Windows7
Office 2007 Ultimate / 2010 Professional
  #3   Report Post  
Posted to microsoft.public.excel.programming
hbj hbj is offline
external usenet poster
 
Posts: 35
Default On-sheet activeX component disables copy/paste

On Wednesday, 2 July 2014 17:43:54 UTC+3, Claus Busch wrote:
Hi Hakan,



Am Wed, 2 Jul 2014 07:36:46 -0700 (PDT) schrieb hbj:



ActiveSheet.OLEObjects("cmdSetReset").Top = rngAct.Top




try:



Private Sub Worksheet_SelectionChange(ByVal Target As Range)

cmdSetReset.Top = Target.Top

End Sub





Regards

Claus B.

--

Vista Ultimate / Windows7

Office 2007 Ultimate / 2010 Professional


Thank you Claus,

Your code is of cource shorter, but it does not solve the main problem. When the code runs it grayes out the Clipboard tool. Only Paste as image is available.

Håkan
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,514
Default On-sheet activeX component disables copy/paste

Thank you Claus,

Your code is of cource shorter, but it does not solve the main problem. When the code runs it grayes out the Clipboard tool. Only Paste as image is available.

Håkan

By default, executing VBA clears the Clipboard of its current contents.

--
-
Garry

Free Usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion
  #5   Report Post  
Posted to microsoft.public.excel.programming
hbj hbj is offline
external usenet poster
 
Posts: 35
Default On-sheet activeX component disables copy/paste

On Wednesday, 2 July 2014 19:38:03 UTC+3, GS wrote:
Thank you Claus,




Your code is of cource shorter, but it does not solve the main problem. When the code runs it grayes out the Clipboard tool. Only Paste as image is available.




H�kan




By default, executing VBA clears the Clipboard of its current contents.



--

-

Garry


Well Garry,

It seems that this is not quite the truth. You can have lot of code in the Worksheet_SelectionChange() procedure, still the Clipboard is not cleared = you can use copy/paste.

In fact, programatically affecting the properties of the embedded ActiveX control clears the clipboard. This fact is partly discussed in the link below:
http://msdn.microsoft.com/en-us/libr...ffice.11).aspx

I think I'd better explicitely activate the ActiveX control, when needed.

HÃ¥kan


  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,514
Default On-sheet activeX component disables copy/paste

On 07/02/2014 2:12 PM, hbj wrote:
On Wednesday, 2 July 2014 19:38:03 UTC+3, GS wrote:
Thank you Claus,




Your code is of cource shorter, but it does not solve the main problem. When the code runs it grayes out the Clipboard tool. Only Paste as image is available.




H�kan




By default, executing VBA clears the Clipboard of its current contents.



--

-

Garry


Well Garry,

It seems that this is not quite the truth. You can have lot of code in the Worksheet_SelectionChange() procedure, still the Clipboard is not cleared = you can use copy/paste.

In fact, programatically affecting the properties of the embedded ActiveX control clears the clipboard. This fact is partly discussed in the link below:
http://msdn.microsoft.com/en-us/libr...ffice.11).aspx

I think I'd better explicitely activate the ActiveX control, when needed.

HÃ¥kan

Sorry but the article you link to does not support your reply!

--
-
Garry

Free Usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion
  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,514
Default On-sheet activeX component disables copy/paste

On 07/02/2014 2:12 PM, hbj wrote:
On Wednesday, 2 July 2014 19:38:03 UTC+3, GS wrote:
Thank you Claus,




Your code is of cource shorter, but it does not solve the main problem. When the code runs it grayes out the Clipboard tool. Only Paste as image is available.




H�kan




By default, executing VBA clears the Clipboard of its current contents.



--

-

Garry


Well Garry,

It seems that this is not quite the truth. You can have lot of code in the Worksheet_SelectionChange() procedure, still the Clipboard is not cleared = you can use copy/paste.

In fact, programatically affecting the properties of the embedded ActiveX control clears the clipboard. This fact is partly discussed in the link below:
http://msdn.microsoft.com/en-us/libr...ffice.11).aspx

I think I'd better explicitely activate the ActiveX control, when needed.

HÃ¥kan

Sorry.., my bad!
I stand corrected as I should have explicitly stated *some" VBA, not all
as my statement suggests. I was thinking in the context of your scenario!<g

--
-
Garry

Free Usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
ActiveX ProgressBar - Scrolling Error disables color update Dreiding Excel Programming 1 February 17th 10 01:15 AM
Activex component can't create object Naveen New Users to Excel 1 September 4th 07 02:57 PM
Use Office spreadsheet component in a ActiveX dll No Name Excel Programming 30 January 28th 04 10:52 PM
Spreadsheet component in an ActiveX dll tmarko Excel Programming 1 January 16th 04 03:42 AM
ActiveX component can't be created Singnet Newsgroup Excel Programming 0 August 6th 03 03:27 PM


All times are GMT +1. The time now is 10:01 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"