+ Reply to Thread
Results 1 to 7 of 7

excel userforms created with a 32 bit machine not loading on a 64 bit machine

  1. #1
    Registered User
    Join Date
    06-13-2013
    Location
    san fernando
    MS-Off Ver
    Excel 2013
    Posts
    6

    excel userforms created with a 32 bit machine not loading on a 64 bit machine

    hi guys i wrote a program for a school project on a 32 bit machine some years ago and now i have upgraded to a 64 bit machine and the userforms no longer loads. i keep getting a message that reads "Could not load objects because they are not available on this machine." Can anyone help me out on this issue? i have attached pictures.
    Attached Images Attached Images

  2. #2
    Forum Contributor
    Join Date
    09-03-2015
    Location
    IE
    MS-Off Ver
    2003 - 2016
    Posts
    258

    Re: excel userforms created with a 32 bit machine not loading on a 64 bit machine

    You need to re-write to suit 64 bit (API declarations etc) and some controls (TreeView, ListView, Calendar and others) are simply not available on 64 Bit.

  3. #3
    Registered User
    Join Date
    01-16-2016
    Location
    Canada
    MS-Off Ver
    2016
    Posts
    18

    Re: excel userforms created with a 32 bit machine not loading on a 64 bit machine

    when you try to run the file there should be lines of code that are in red such as the following. There will be likely more than one line of code in red.

    1. Public Declare Function SetTimer Lib "user32" (ByVal hwnd As Long, ByVal nIDEvent As Long, ByVal uElapse As Long, ByVal lpTimerFunc As Long) As Long


    You must type "PtrSafe" before the word "Fuction" in each line of code so the line of code looks like this.

    1. Public Declare PtrSafe Function SetTimer Lib "user32" (ByVal hwnd As Long, ByVal nIDEvent As Long, ByVal uElapse As Long, ByVal lpTimerFunc As Long) As Long

  4. #4
    Forum Contributor
    Join Date
    09-03-2015
    Location
    IE
    MS-Off Ver
    2003 - 2016
    Posts
    258

    Re: excel userforms created with a 32 bit machine not loading on a 64 bit machine

    With respect - the suggested changes are not correct. Parameters which are Window Handles must use the LONGPTR variable type, otherwise results from the Function could be incorrect.

    I'm not going to explain - it's something the OP needs to understand rather than blindly using code that potentially could crash Excel: https://msdn.microsoft.com/en-us/lib.../gg264421.aspx

  5. #5
    Registered User
    Join Date
    01-16-2016
    Location
    Canada
    MS-Off Ver
    2016
    Posts
    18

    Re: excel userforms created with a 32 bit machine not loading on a 64 bit machine

    "PtrSafe" worked for me. It solved my 32bit to 64 bit problems. all files work fine now. Excel has not crashed.

  6. #6
    Forum Contributor
    Join Date
    09-03-2015
    Location
    IE
    MS-Off Ver
    2003 - 2016
    Posts
    258

    Re: excel userforms created with a 32 bit machine not loading on a 64 bit machine

    OK.

    Feel free to ignore the comments on the page I linked: "The problem with running legacy VBA code in 64-bit Office is that trying to load 64-bits into a 32-bit data type truncates the 64-bit quantity. This can result in memory overruns, unexpected results in your code, and possible application failure".

    Much like my comment to the OP I would respectfully suggest you should read and make sure you understand the contents of that page.

  7. #7
    Registered User
    Join Date
    06-13-2013
    Location
    san fernando
    MS-Off Ver
    Excel 2013
    Posts
    6

    Re: excel userforms created with a 32 bit machine not loading on a 64 bit machine

    hey guys i've done both i've used the ptrsafe and the longptr and they work but the main problem i'm having is that it seems as though all those userform objects/controls(e.g progress bar) that i've used are no longer available in 64 bit because im still getting the message saying "Could not load objects because they are not available on this machine". Everything is working perfectly on my 32 bit machine.

+ 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. Loading data from server into Excel on client machine
    By pulling out my hair in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-12-2013, 10:45 AM
  2. Replies: 1
    Last Post: 02-06-2013, 06:13 PM
  3. Working code on my machine is returning out of range error on another machine.
    By je.suis.ketan in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-16-2012, 11:51 PM
  4. Add machine type next to machine number
    By Trishay321 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-08-2011, 07:13 AM
  5. Macro runs fine on my machine; won't run on another user's machine
    By brl8 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-29-2010, 03:16 PM
  6. Replies: 2
    Last Post: 03-01-2006, 12:25 AM
  7. Replies: 6
    Last Post: 02-28-2006, 01:20 AM
  8. Replies: 1
    Last Post: 07-17-2005, 11:05 PM

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