visual basic code in 2003 vs 2007

  • Thread starter Thread starter George Applegate
  • Start date Start date
G

George Applegate

I have some visual basic code that runs in an excel 2003 spreadsheet.
It runs on some PC's that have excel 2007, but not all, so I'm
guessing it's some sort of setting within excel??? I have macros
enabled on 2007 but it must be some other setting???? Any ideas where
I can look?

Here is the visual basic code. As I said, it runs on some PC's with
excel 2007 installed, just not all of them. Any ideas? As I said, I
ahve macros enabled on all of them.

Sub Worksheet_Change(ByVal Target As Excel.Range)
If Intersect(Range("C7:C14"), Target) Is Nothing Then Exit Sub
Application.EnableEvents = False
Range("c2").Value = Now()
Application.EnableEvents = True
End Sub

thanks, ga
George Applegate
(e-mail address removed)
 
What happens on the pc's where it doesn't work?

If you're positive that macros are enabled, then maybe you turned off events
(while testing???) and didn't re-enable them.

Open the VBE (alt-F11)
Show the immediate window (ctrl-g)
type this:
application.enableevents = true
and hit enter

Then back to excel to test.

If this doesn't help, you may want to explain what happens where it doesn't
work.
 
Back
Top