Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 846
Default Invalid Outside Procedure

I have a program that auto updates a cell in several worksheets of a workbook
when a value is changed on another worksheet in the same workbook. The
program works flawlessly on my computer; however, when a colleague opens the
workbook and the program is triggered he gets an Invalid Outside Procedure
Error. He has the same VB references and excel addins active that I have.
Here is the code.

Private Sub Worksheet_Change(ByVal Target As Range)
'
' Auto update Rev Level and Date when a change is made on the rev guide sheet
'
'== Declare Variables
Dim iRevLevel As Integer
Dim dRevDate As Date
Dim ws As Worksheet
'==
'== Get the latest rev level and date from Rev Guide Worksheet
iRevLevel = Worksheets("Rev Guide").Range("A1").End(xlDown).Value
dRevDate = Worksheets("Rev Guide").Range("F1").End(xlDown).Value
'==
'== Loop through all worksheets and update rev level and date
For Each ws In ActiveWorkbook.Worksheets

If ws.Name < "Rev Guide" Then
ws.Range("M3").Value = "Rev. " & iRevLevel
ws.Range("K3").Value = "Date: " & dRevDate
End If

Next ws
'==
End Sub

Any ideas? Thanks in advance
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 846
Default Invalid Outside Procedure

Forgot to mention the Location the error occurs at is

iRevLevel = Worksheets("Rev Guide").Range("A1").End(xlDown).Value

^Here
"Brad" wrote:

I have a program that auto updates a cell in several worksheets of a workbook
when a value is changed on another worksheet in the same workbook. The
program works flawlessly on my computer; however, when a colleague opens the
workbook and the program is triggered he gets an Invalid Outside Procedure
Error. He has the same VB references and excel addins active that I have.
Here is the code.

Private Sub Worksheet_Change(ByVal Target As Range)
'
' Auto update Rev Level and Date when a change is made on the rev guide sheet
'
'== Declare Variables
Dim iRevLevel As Integer
Dim dRevDate As Date
Dim ws As Worksheet
'==
'== Get the latest rev level and date from Rev Guide Worksheet
iRevLevel = Worksheets("Rev Guide").Range("A1").End(xlDown).Value
dRevDate = Worksheets("Rev Guide").Range("F1").End(xlDown).Value
'==
'== Loop through all worksheets and update rev level and date
For Each ws In ActiveWorkbook.Worksheets

If ws.Name < "Rev Guide" Then
ws.Range("M3").Value = "Rev. " & iRevLevel
ws.Range("K3").Value = "Date: " & dRevDate
End If

Next ws
'==
End Sub

Any ideas? Thanks in advance

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 846
Default Invalid Outside Procedure

Forgot to mention the location of the error

iRevLevel = Worksheets("Rev Guide").Range("A1").End(xlDown).Value

^ Here
"Brad" wrote:

I have a program that auto updates a cell in several worksheets of a workbook
when a value is changed on another worksheet in the same workbook. The
program works flawlessly on my computer; however, when a colleague opens the
workbook and the program is triggered he gets an Invalid Outside Procedure
Error. He has the same VB references and excel addins active that I have.
Here is the code.

Private Sub Worksheet_Change(ByVal Target As Range)
'
' Auto update Rev Level and Date when a change is made on the rev guide sheet
'
'== Declare Variables
Dim iRevLevel As Integer
Dim dRevDate As Date
Dim ws As Worksheet
'==
'== Get the latest rev level and date from Rev Guide Worksheet
iRevLevel = Worksheets("Rev Guide").Range("A1").End(xlDown).Value
dRevDate = Worksheets("Rev Guide").Range("F1").End(xlDown).Value
'==
'== Loop through all worksheets and update rev level and date
For Each ws In ActiveWorkbook.Worksheets

If ws.Name < "Rev Guide" Then
ws.Range("M3").Value = "Rev. " & iRevLevel
ws.Range("K3").Value = "Date: " & dRevDate
End If

Next ws
'==
End Sub

Any ideas? Thanks in advance

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Invalid Outside Procedure

If it's a different workbook, then I would suspect that there are additional
characters (maybe whitespace) outside the procedures you've created. Or maybe
that workbook has the procedure name commented?

If it's the same workbook, maybe it's caused by an error in one of that person's
other workbooks.



Maybe it's not numeric

Brad wrote:

I have a program that auto updates a cell in several worksheets of a workbook
when a value is changed on another worksheet in the same workbook. The
program works flawlessly on my computer; however, when a colleague opens the
workbook and the program is triggered he gets an Invalid Outside Procedure
Error. He has the same VB references and excel addins active that I have.
Here is the code.

Private Sub Worksheet_Change(ByVal Target As Range)
'
' Auto update Rev Level and Date when a change is made on the rev guide sheet
'
'== Declare Variables
Dim iRevLevel As Integer
Dim dRevDate As Date
Dim ws As Worksheet
'==
'== Get the latest rev level and date from Rev Guide Worksheet
iRevLevel = Worksheets("Rev Guide").Range("A1").End(xlDown).Value
dRevDate = Worksheets("Rev Guide").Range("F1").End(xlDown).Value
'==
'== Loop through all worksheets and update rev level and date
For Each ws In ActiveWorkbook.Worksheets

If ws.Name < "Rev Guide" Then
ws.Range("M3").Value = "Rev. " & iRevLevel
ws.Range("K3").Value = "Date: " & dRevDate
End If

Next ws
'==
End Sub

Any ideas? Thanks in advance


--

Dave Peterson
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 846
Default Invalid Outside Procedure

It is the same workbook. What kind of error should I look for?

"Dave Peterson" wrote:

If it's a different workbook, then I would suspect that there are additional
characters (maybe whitespace) outside the procedures you've created. Or maybe
that workbook has the procedure name commented?

If it's the same workbook, maybe it's caused by an error in one of that person's
other workbooks.



Maybe it's not numeric

Brad wrote:

I have a program that auto updates a cell in several worksheets of a workbook
when a value is changed on another worksheet in the same workbook. The
program works flawlessly on my computer; however, when a colleague opens the
workbook and the program is triggered he gets an Invalid Outside Procedure
Error. He has the same VB references and excel addins active that I have.
Here is the code.

Private Sub Worksheet_Change(ByVal Target As Range)
'
' Auto update Rev Level and Date when a change is made on the rev guide sheet
'
'== Declare Variables
Dim iRevLevel As Integer
Dim dRevDate As Date
Dim ws As Worksheet
'==
'== Get the latest rev level and date from Rev Guide Worksheet
iRevLevel = Worksheets("Rev Guide").Range("A1").End(xlDown).Value
dRevDate = Worksheets("Rev Guide").Range("F1").End(xlDown).Value
'==
'== Loop through all worksheets and update rev level and date
For Each ws In ActiveWorkbook.Worksheets

If ws.Name < "Rev Guide" Then
ws.Range("M3").Value = "Rev. " & iRevLevel
ws.Range("K3").Value = "Date: " & dRevDate
End If

Next ws
'==
End Sub

Any ideas? Thanks in advance


--

Dave Peterson



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Invalid Outside Procedure

I would look for any characters outside any procedure.

Maybe copy and pasting into NotePad, deleting the module and the pasting back
into a new module would help. Just make sure you take the portion of the code
that is required.

Brad wrote:

It is the same workbook. What kind of error should I look for?

"Dave Peterson" wrote:

If it's a different workbook, then I would suspect that there are additional
characters (maybe whitespace) outside the procedures you've created. Or maybe
that workbook has the procedure name commented?

If it's the same workbook, maybe it's caused by an error in one of that person's
other workbooks.



Maybe it's not numeric

Brad wrote:

I have a program that auto updates a cell in several worksheets of a workbook
when a value is changed on another worksheet in the same workbook. The
program works flawlessly on my computer; however, when a colleague opens the
workbook and the program is triggered he gets an Invalid Outside Procedure
Error. He has the same VB references and excel addins active that I have.
Here is the code.

Private Sub Worksheet_Change(ByVal Target As Range)
'
' Auto update Rev Level and Date when a change is made on the rev guide sheet
'
'== Declare Variables
Dim iRevLevel As Integer
Dim dRevDate As Date
Dim ws As Worksheet
'==
'== Get the latest rev level and date from Rev Guide Worksheet
iRevLevel = Worksheets("Rev Guide").Range("A1").End(xlDown).Value
dRevDate = Worksheets("Rev Guide").Range("F1").End(xlDown).Value
'==
'== Loop through all worksheets and update rev level and date
For Each ws In ActiveWorkbook.Worksheets

If ws.Name < "Rev Guide" Then
ws.Range("M3").Value = "Rev. " & iRevLevel
ws.Range("K3").Value = "Date: " & dRevDate
End If

Next ws
'==
End Sub

Any ideas? Thanks in advance


--

Dave Peterson


--

Dave Peterson
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
Invalid procedure call or argument salgud Excel Programming 1 January 12th 09 10:41 PM
Invalid Procedure Call Pops Jackson Excel Programming 6 December 18th 08 10:56 PM
Invalid procedure call trying to use FormatConditions Jay Excel Programming 1 May 30th 08 09:24 PM
invalid procedure call geebee Excel Programming 1 November 26th 07 04:17 PM
Invalid Procedure kldempsey Excel Programming 2 August 25th 04 04:25 AM


All times are GMT +1. The time now is 09:29 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"