+ Reply to Thread
Results 1 to 4 of 4

Drag and Drop Dynamically using Class Module

  1. #1
    Registered User
    Join Date
    09-04-2014
    Location
    WA, USA
    MS-Off Ver
    2007
    Posts
    69

    Drag and Drop Dynamically using Class Module

    I'd like to use my 'Drag and Drop' code in a class module so that it can be dynamic. (I do not want to have to recreate the code for every new image).

    This code is in a class module:
    Please Login or Register  to view this content.
    This Code is in a normal module.
    Please Login or Register  to view this content.
    And the code is called here when the Userform is opened initially:
    Please Login or Register  to view this content.
    I get an error saying "Variable not defined". 'Move Me' is highlighted and I assume the public variable is not transferring to the sub? Any help here? Thanks! (btw, the code works great in the userform without the class module, so I assume it is the rules of a class module?)

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Drag and Drop Dynamically using Class Module

    Any chance you could upload a sample workbook?

    Click on GO ADVANCED, scroll down and click Manage Attachments.
    If posting code please use code tags, see here.

  3. #3
    Registered User
    Join Date
    09-04-2014
    Location
    WA, USA
    MS-Off Ver
    2007
    Posts
    69

    Re: Drag and Drop Dynamically using Class Module

    Thanks for suggesting that I provide the sample workbook. I've suddenly got the thing working after I recreated it in an isolated new workbook. I'll show you my solution, but I need to find out why it isn't working in my larger workbook now.
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    09-04-2014
    Location
    WA, USA
    MS-Off Ver
    2007
    Posts
    69

    Re: Drag and Drop Dynamically using Class Module

    It appears that (
    Please Login or Register  to view this content.
    ) was not being declared at the top of my code. I had cut and paste it, putting it after a sub (which caused it to stop functioning). It is working now, thank you Norie! Just suggesting to give a sample helped me fix a problem I've had for 2 days! The bizarre peculiarities of coding continue to astound me...

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Using Class Module for handling events of dynamically created controls
    By jagman in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 10-17-2018, 01:14 PM
  2. [SOLVED] ComboBox class .AddItem filled in class module
    By Jacques Grobler in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 07-03-2012, 05:48 AM
  3. Replies: 1
    Last Post: 08-30-2011, 02:23 AM
  4. class module?
    By sybmathics in forum Excel Programming / VBA / Macros
    Replies: 17
    Last Post: 02-25-2006, 10:35 AM
  5. Module vs Class Module
    By DCSwearingen in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-13-2006, 07:45 PM
  6. Class Module & Module
    By Liedson31 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-08-2005, 11:05 AM
  7. class module
    By anonymousA in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-02-2005, 07:08 AM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1