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

What does it mean when it says -
Complie error:
Invlid Outside Procedure

How do I fix this

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default compile error

It means that whatever is highlighted (e.g., an external function
declaration) cannot be declared within a Sub or Function
procedure. Move that item outside of and prior to any procedure.
It would be helpful if you posted the code that is causing the
problem.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com




"Fraggs " wrote in
message ...
What does it mean when it says -
Complie error:
Invlid Outside Procedure

How do I fix this?


---
Message posted from http://www.ExcelForum.com/



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default compile error


Code
-------------------
Answer = MsgBox("Do you want to continue ?", _
vbOKCancel, "My Title")
If Answer = vbOK Then ActiveWorkbook.FollowHyperlink Address:= _
"Q:\AR, Retail Support & Cash Management\Retail Support\VOUCHERS\New Vouchers\Live\Voucher Issue Spreadsheets to date\Corporate Voucher Issues to date.xls" _
, NewWindow:=False, AddHistory:=True
Sheets("Nav").Select
Range("A1").Select
Else
If Answer = vbCancel Then Exit Su
-------------------


Thats the offending code. doesnt want to work for some reason :

--
Message posted from http://www.ExcelForum.com

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default compile error

It sounds like you have something outside your procedure.

This version (untested for the long path) seems to work ok:

Option Explicit
Sub testme()

Dim Answer As Long

Answer = MsgBox("Do you want to continue ?", _
vbOKCancel, "My Title")
If Answer = vbOK Then
ActiveWorkbook.FollowHyperlink Address:= _
"Q:\AR, Retail Support & Cash Management\Retail Support\" & _
"VOUCHERS\New Vouchers\Live\Voucher Issue Spreadsheets to date\" _
& "Corporate Voucher Issues to date.xls", _
NewWindow:=False, AddHistory:=True
Sheets("Nav").Select
Range("A1").Select
Else
Exit Sub
End If

End Sub

Check for extraneous characters after your End Sub or between any End Sub and
next Sub (if you have multiple procedures within the module).



"Fraggs <" wrote:

Code:
--------------------
Answer = MsgBox("Do you want to continue ?", _
vbOKCancel, "My Title")
If Answer = vbOK Then ActiveWorkbook.FollowHyperlink Address:= _
"Q:\AR, Retail Support & Cash Management\Retail Support\VOUCHERS\New Vouchers\Live\Voucher Issue Spreadsheets to date\Corporate Voucher Issues to date.xls" _
, NewWindow:=False, AddHistory:=True
Sheets("Nav").Select
Range("A1").Select
Else
If Answer = vbCancel Then Exit Sub
--------------------

Thats the offending code. doesnt want to work for some reason :(

---
Message posted from http://www.ExcelForum.com/


--

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
Solver - error - Compile Error Nina Excel Discussion (Misc queries) 0 August 19th 08 09:41 PM
help with this error-Compile error: cant find project or library JackR Excel Discussion (Misc queries) 2 June 10th 06 09:09 PM
How do I get rid of "Compile error in hidden module" error message David Excel Discussion (Misc queries) 4 January 21st 05 11:39 PM
Compile error in hidden module error Melissa Zebrowski Excel Programming 3 February 20th 04 01:29 PM


All times are GMT +1. The time now is 02:55 AM.

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

About Us

"It's about Microsoft Excel"