Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default worksheet subroutine causes Compile error: Not found when on User

Attempts to execute a subroutine (or function) defined on a worksheet module
fail with compile error: sub - function not found. The sub works fine when
called from another worksheet. I open the user form nonmodally to allow
worksheet tasks. I have checked the spelling of the subroutine and it is
defined as Public.
Thanks, Jim
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default worksheet subroutine causes Compile error: Not found when on User

Preface the call with a reference to the worksheet where the routine is
stored.

Call Sheets("Sheet1").Myprocedure
or
Call Sheet1.Myprocedure

--
HTH...

Jim Thomlinson


"Jim Brownson" wrote:

Attempts to execute a subroutine (or function) defined on a worksheet module
fail with compile error: sub - function not found. The sub works fine when
called from another worksheet. I open the user form nonmodally to allow
worksheet tasks. I have checked the spelling of the subroutine and it is
defined as Public.
Thanks, Jim

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default worksheet subroutine causes Compile error: Not found when on U

Works great. I should have though of that, but am following examples in Jeff
Webb & Seve Saunders new book: Programming Excel with vba & .net from
O'rielly- pgs 802+. Their examples show just the sub or function name (not
qualified by the sheet name). Other than this minor problem, great book. Much
Thanks, Jim

"Jim Thomlinson" wrote:

Preface the call with a reference to the worksheet where the routine is
stored.

Call Sheets("Sheet1").Myprocedure
or
Call Sheet1.Myprocedure

--
HTH...

Jim Thomlinson


"Jim Brownson" wrote:

Attempts to execute a subroutine (or function) defined on a worksheet module
fail with compile error: sub - function not found. The sub works fine when
called from another worksheet. I open the user form nonmodally to allow
worksheet tasks. I have checked the spelling of the subroutine and it is
defined as Public.
Thanks, Jim

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default worksheet subroutine causes Compile error: Not found when on U

You do not have to reference a module, but you do neet to explicitly
reference sheets and ThisWorkbook to use their procedures.
--
HTH...

Jim Thomlinson


"Jim Brownson" wrote:

Works great. I should have though of that, but am following examples in Jeff
Webb & Seve Saunders new book: Programming Excel with vba & .net from
O'rielly- pgs 802+. Their examples show just the sub or function name (not
qualified by the sheet name). Other than this minor problem, great book. Much
Thanks, Jim

"Jim Thomlinson" wrote:

Preface the call with a reference to the worksheet where the routine is
stored.

Call Sheets("Sheet1").Myprocedure
or
Call Sheet1.Myprocedure

--
HTH...

Jim Thomlinson


"Jim Brownson" wrote:

Attempts to execute a subroutine (or function) defined on a worksheet module
fail with compile error: sub - function not found. The sub works fine when
called from another worksheet. I open the user form nonmodally to allow
worksheet tasks. I have checked the spelling of the subroutine and it is
defined as Public.
Thanks, Jim

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
Compile error: Method or data member not found Brian Day Excel Worksheet Functions 0 July 22nd 07 03:20 AM
Compile Error Method or data member not found ExcelMonkey Excel Programming 1 October 4th 05 10:41 PM
Compile Error: Method or data member not found Nick S[_4_] Excel Programming 0 November 16th 04 04:43 PM
Compile Error: Method or data member not found Nick S[_3_] Excel Programming 2 November 16th 04 02:38 PM
Compile Error: Method or data member not found Nick S[_2_] Excel Programming 1 November 16th 04 11:41 AM


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