Macros and Active X

A

Aversin

My ctrl+c and ctrl+v shortcuts dont work unless I turn on my active
forms bar to edit mode. Any guesses why
 
K

kkknie

Because the spreadhseet is "live". You have to go into edit mode t
make any changes to control toolbox items.
 
A

Aversin

I'm not trying to edit my active x forms, The problems is that th
standard ctrl+c and ctrl+v copy and paste short cuts wont work unles
the active x edit mode is turned on.

I don't have to turn on the active x edit mode to use these short cut
in other wookbooks, so any idea why I would need to in this one
 
K

kkknie

Many appologies. Is it possible that a macro was recorded in thi
workbook and assigned to ctrl-c and ctrl-v?
 
A

Aversin

I have no user written macros. That was my guess too, but I was wrong.
Any other ideas? I'm out of them.
 
K

kkknie

Maybe try copying the worksheets to another workbook, save it, close th
original and see if this still happens. Other than that, I'm stumped.
 
A

Aversin

If I take this section of code out it works as normal (ctrl+c
ctrl+v)....any ideas now

here is the code

Public Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
Dim L As Double
Dim T As Double
Dim MaxR As Double
Dim MaxB As Double
Dim n As Integer
Dim ListR As Double
Dim ListB As Double

ListBox1.Width = 150
ListBox1.Height = 300

MaxR = Cells(1, 256).Left + Cells(1, 256).Width
MaxB = Cells(65536, 1).Top + Cells(65536, 1).Height

If ActiveCell.Column <= 2 Then
n = 0
Else
n = -2
End If

L = ActiveCell.Offset(0, n).Left
T = ActiveCell.Offset(1, n).Top

ListR = L + ListBox1.Width
ListB = T + ListBox1.Height

If ListR >= MaxR Then
L = MaxR - ListBox1.Width - (MaxR - ActiveCell.Offset(0
-1).Left)
End If

If ListB >= MaxB Then
T = MaxB - ListBox1.Height
End If

ListBox1.Top = T
ListBox1.Left = L
End Su
 
K

kkknie

Aha!

I've had the same issue and did not resolve it. It seems that when yo
run the code, the cut/copy mode turns off. I don't think you can chec
for this in a simple way (i.e.)

If Application.CutCopyMode = True Then...

Do you really need to be running this code every time the a new cell i
selected? Looks like you are moving a list box around to keep it nea
the selected cell.

Sorry, I have no great solution.
 
A

Aversin

I guess I dont have to run the code, but it sure is handy. I guess I
could find a way to turn write a macro to turn it on and off, or just
scrap the whole thing...hummmmm
 
D

Dave Peterson

Do you have any event procedures--worksheet_change, worksheet_activate???

If yes, then lots of times, macros (including events) kill the clipboard.

By going into design mode, you're telling excel you're still developing stuff.
 
A

Aversin

Thanks for all of the help guys. I have a frozen payne at the top of the
worksheet, so I just placed it there and decided that I didnt need it to
follow me around the page.

But is there a way to have a macro run and kill a VB script?
 
Top