Results 1 to 3 of 3

Thread: accessing module function from sheet code

  1. #1

    Thread Starter
    New Member
    Join Date
    Mar 2008
    Posts
    15

    accessing module function from sheet code

    Hi,

    I thought this was a standard question but I can't find it anywhere. Anyway.

    withing a Worksheet_SelectionChange routine I need to either:

    -access a global variable declared within a standard module (error message: Compile error: only user-defined types defined in public object modules can be coerced to or from a variant or passed to late-bound functions) OR

    -run a public function and a sub declared within a standard module (error message: "internal error")

    Any clue how to do this?

    Thanks in advance!!

    (an answer to do both would obviously also be great)

  2. #2
    Frenzied Member zaza's Avatar
    Join Date
    Apr 2001
    Location
    Borneo Rainforest Habits: Scratching
    Posts
    1,486

    Re: accessing module function from sheet code

    I think you must have set something up strangely in your code. Both of these are normal to do in VBA. Where did you get your module from? Sounds a bit suspicious that neither of these two things work.
    I use VB 6, VB.Net 2003 and Office 2010



    Code:
    Excel Graphing | Excel Timer | Excel Tips and Tricks | Add controls in Office | Data tables in Excel | Gaussian random number distribution (VB6/VBA,VB.Net) | Coordinates, Vectors and 3D volumes

  3. #3

    Thread Starter
    New Member
    Join Date
    Mar 2008
    Posts
    15

    Re: accessing module function from sheet code

    you're right, I restarted the workbook and it worked. No clue what went wrong before....

    Thanks anyway!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width