+ Reply to Thread
Results 1 to 7 of 7

Class recently stopped working - RtlMoveMemory

  1. #1
    Valued Forum Contributor
    Join Date
    08-29-2012
    Location
    In lockdown
    MS-Off Ver
    Excel 2010 (2003 to 2016 but 2010 for choice)
    Posts
    1,766

    Class recently stopped working - RtlMoveMemory

    I have a class module I downloaded from the internet some time ago. And it has been working fine for some time. However I tried using it today and it no longer works. Every time I run it now it crashes.

    I have made no change to the original code so I am wondering whether it could be some change to the Windows environment?

    When I step through it, it works up until the last line in the extract below (it then gives the "Excel has stopped working" message):
    Please Login or Register  to view this content.

    CastToObject code below:
    Please Login or Register  to view this content.
    Is there anybody who can lend a hand on this?
    *******************************************************

    HELP WANTED! (Links to Forum threads)
    Trying to create reusable code for Custom Events at Workbook (not Application) level

    *******************************************************

  2. #2
    Forum Expert Debraj Roy's Avatar
    Join Date
    09-27-2012
    Location
    New Delhi,India
    MS-Off Ver
    Excel 2013
    Posts
    1,469

    Re: Class recently stopped working - RtlMoveMemory

    Just a blind-shot..

    Remove PtrSafe and VarPtr, they both bit conversion keywords.. and you may not need them in your excel version..
    Regards!
    =DEC2HEX(3563)

    If you like someone's answer, click the star to give them a reputation point for that answer...

  3. #3
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,263

    Re: Class recently stopped working - RtlMoveMemory

    What's the value of sizeof_ptr and how is it declared?

    Posting more code will probably help.
    Remember what the dormouse said
    Feed your head

  4. #4
    Valued Forum Contributor
    Join Date
    08-29-2012
    Location
    In lockdown
    MS-Off Ver
    Excel 2010 (2003 to 2016 but 2010 for choice)
    Posts
    1,766

    Re: Class recently stopped working - RtlMoveMemory

    Quote Originally Posted by Debraj Roy View Post
    Just a blind-shot..

    Remove PtrSafe and VarPtr, they both bit conversion keywords.. and you may not need them in your excel version..
    I'm running Excel 2010 32 bit edition on Windows 7.

    I tried your suggestion:

    First it ran into a 'Type not declared' error on
    Please Login or Register  to view this content.
    So I changed that back and continued to F8.

    Then I got the usual 'Excel has stopped responding' crash message on the
    Please Login or Register  to view this content.
    line again.

    Thank you for trying to help.

  5. #5
    Valued Forum Contributor
    Join Date
    08-29-2012
    Location
    In lockdown
    MS-Off Ver
    Excel 2010 (2003 to 2016 but 2010 for choice)
    Posts
    1,766

    Re: Class recently stopped working - RtlMoveMemory

    Quote Originally Posted by romperstomper View Post
    What's the value of sizeof_ptr and how is it declared?
    Hi Rory, the value of SIZEOF_PTR = 4 and it is declared as follows (extracts below)

    extract 1
    Please Login or Register  to view this content.
    Extract 2
    Please Login or Register  to view this content.

    Quote Originally Posted by romperstomper View Post
    Posting more code will probably help.
    I was worried that posting the code may put forum users off from helping out on this thread...

    The code is very heavy stuff - I have never seen any VBA code remotely like it. It's quote "a Virtual-COM module that creates native-code x86 COM objects in memory" unquote.

    OK, I will upload the classes in the next post.
    Last edited by mc84excel; 11-19-2014 at 06:42 PM. Reason: readability

  6. #6
    Valued Forum Contributor
    Join Date
    08-29-2012
    Location
    In lockdown
    MS-Off Ver
    Excel 2010 (2003 to 2016 but 2010 for choice)
    Posts
    1,766

    Re: Class recently stopped working - RtlMoveMemory

    Here's the code. It's too big to paste into a single forum post so I have placed all 4 class modules into a workbook in order to upload.

    The error is occurring in the Class Initialize event.
    Attached Files Attached Files
    Last edited by mc84excel; 11-19-2014 at 06:50 PM. Reason: readability

  7. #7
    Valued Forum Contributor
    Join Date
    08-29-2012
    Location
    In lockdown
    MS-Off Ver
    Excel 2010 (2003 to 2016 but 2010 for choice)
    Posts
    1,766

    Re: Class recently stopped working - RtlMoveMemory

    Curiouser and Curiouser.

    While I haven't intentionally make any edits to the code, it occurred to me that I *may* have inadvertently done so.

    Unfortunately I don't have copy of the original code (and the original web pages are down) but I had an August backup of the project I use it in. I exported/imported the code modules to the current version and reran the code. You guessed it - it no longer crashes now.

    I guess the lessons learnt here are:
    1. Always keep an unedited copy of code you didn't create yourself
    2. Keep backups on any project that is undergoing frequent changes.

+ 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. Copy two array: Function RtlMoveMemory() in Excel 64-bit is error?
    By tuanktcdcn in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-07-2013, 02:44 PM
  2. ocde working in one windows login but stopped working in another.
    By rama1209 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-02-2011, 08:38 AM
  3. Everything stopped working
    By vamedic11 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-30-2010, 11:20 PM
  4. It's stopped working
    By mikhailia in forum Excel Programming / VBA / Macros
    Replies: 32
    Last Post: 01-22-2007, 10:12 PM
  5. VB Stopped Working
    By [email protected] in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-28-2005, 09:06 AM

Tags for this Thread

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