+ Reply to Thread
Results 1 to 16 of 16

Office 365 causes errors in VBA code for SAS object

  1. #1
    Registered User
    Join Date
    02-04-2021
    Location
    MA, USA
    MS-Off Ver
    2016
    Posts
    20

    Unhappy Office 365 causes errors in VBA code for SAS object

    I got Microsoft Visual Basic Run-time error '-2147221164(80040154)': class not registered

    when I got Office 365 installed and ran the following vba code with SAS object:
    Please Login or Register  to view this content.
    Please help if you've seen something like this, thank you!
    Last edited by AliGW; 08-30-2024 at 01:41 AM. Reason: Code tags added - please review the forum guidelines.

  2. #2
    Forum Expert skywriter's Avatar
    Join Date
    06-09-2014
    Location
    USA
    MS-Off Ver
    365 Version 2409
    Posts
    2,789

    Re: Office 365 causes errors in VBA code for SAS object

    I have no idea what that is but does it require a reference to be checked in the vba editor, maybe?

  3. #3
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    26,986

    Re: Office 365 causes errors in VBA code for SAS object

    Do you have the SAS API library installed for Excel VBA? Was the same code running correctly in a prior version of Excel? If you upgraded Excel, did you switch from 32-bit to 64-bit when you upgraded?

    Administrative Note:

    Welcome to the forum.

    We would very much like to help you with your query, however we recommend that you include code tags around your code.

    Please take a moment to add the tags. Posting code between [code]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/code] tags makes your code much easier to read and copy for testing, and it also maintains VBA formatting.

    Please see Forum Guideline #2 about code tags and adjust accordingly. Click on Edit to open your post, then highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  4. #4
    Registered User
    Join Date
    02-04-2021
    Location
    MA, USA
    MS-Off Ver
    2016
    Posts
    20

    Re: Office 365 causes errors in VBA code for SAS object

    Jeff,

    Yes, I have the SAS API library installed and the same code was running correctly in a prior version of Excel (32-bit). Once I switched to Office 365 (64-bit), the "class not registered" error showed up for that piece of code.

    thank you!
    Last edited by Snowflakes2021; 08-30-2024 at 08:17 AM.

  5. #5
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,998

    Re: Office 365 causes errors in VBA code for SAS object

    You probably don't have a 64bit compatible version of the library then, in which case it won't work with 64bit Office.
    Everyone who confuses correlation and causation ends up dead.

  6. #6
    Registered User
    Join Date
    02-04-2021
    Location
    MA, USA
    MS-Off Ver
    2016
    Posts
    20

    Re: Office 365 causes errors in VBA code for SAS object

    Is there a way I can check on my side to find out if it's 64-bit version of the library or not?

  7. #7
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,998

    Re: Office 365 causes errors in VBA code for SAS object

    See if you can locate where the dll is and that may give you an indication (eg if it's in Program Files (x86) it's a 32 bit program, so the dll is probably 32bit too.), or it might specify it in the properties of the file.

  8. #8
    Registered User
    Join Date
    02-04-2021
    Location
    MA, USA
    MS-Off Ver
    2016
    Posts
    20

    Re: Office 365 causes errors in VBA code for SAS object

    It's hard for me to tell actually. The VBA reference is pointing to Program Files > SASHome > x86 > ... for the dll file.

    And the IT people is telling me that the SAS Add-in for MS Office 365 is 64-bit version. But the SAS Add-in is not the same thing as the SAS API library, right?

  9. #9
    Forum Contributor
    Join Date
    10-02-2012
    Location
    UK
    MS-Off Ver
    Office 365
    Posts
    293

    Re: Office 365 causes errors in VBA code for SAS object

    Given that it's in a folder called "x86" would suggest it's a 32-bit version of the reference.

    Looking at the support pages for SAS, if you're running the 64-bit version, you should have both references (64 and 32).

    https://blogs.sas.com/content/sasdum...bit%20versions).

  10. #10
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    26,986

    Re: Office 365 causes errors in VBA code for SAS object

    The add-in contains the API/dll. IT said the add-in for 365 is 64-bit, and your current add-in is in the x86 folder which implies it's 32-bit. Ask IT for the latest add-in. You can remove the old one, add the new one, check that as a reference, and hopefully be good to go.
    Last edited by 6StringJazzer; 08-30-2024 at 02:29 PM.

  11. #11
    Registered User
    Join Date
    02-04-2021
    Location
    MA, USA
    MS-Off Ver
    2016
    Posts
    20

    Re: Office 365 causes errors in VBA code for SAS object

    I found this help page at sas help center: https://documentation.sas.com/doc/en...tlxhlbjzcd.htm

    so for 64-bit windows, the default has two directories and I found both in my computer.

    I found this on google:

    The easiest method to find out if a DLL, UFL, or EXE is 32 or 64-bit is to open it in Notepad or another text editor such as Notapad++. After opening the file in a text editor, use the Find option to look for the 1st occurrence of the word PE. The letters after the PE header denote if the file is 32-bit or 64-bit.
    · PE L = 32-bit (x86)
    · PE d† = 64-bit (x64)

    And I opened the dll file with a notepad and find PE L, so it is 32-bit. Did anyone used this method to test a dll file to be 32/64 bit? Is it true?
    Last edited by Snowflakes2021; 08-30-2024 at 03:17 PM.

  12. #12
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    26,986

    Re: Office 365 causes errors in VBA code for SAS object

    That "easiest method" sounds like nonsense to me. Those files are binary, not ASCII, and Notepad can't read them. There might be an ASCII string embedded in a header or something but I think you would need a hex editor to read it.

  13. #13
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,998

    Re: Office 365 causes errors in VBA code for SAS object

    Notepad can open binary files just fine - they just look like gibberish for the most part.

  14. #14
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    26,986

    Re: Office 365 causes errors in VBA code for SAS object

    I picked a .exe at random and opened it in a text editor. If your text editor has the ability to open this type of file you can see the content. Here are the first characters.

    MZP······ÿÿ··¸·······@·····································º·´ Í!¸LÍ!This program must be run under Win32

    I also found this string near the beginning of the file:

    PE··L

    Not exactly the flag you mentioned but it could be similar.

  15. #15
    Registered User
    Join Date
    02-04-2021
    Location
    MA, USA
    MS-Off Ver
    2016
    Posts
    20

    Re: Office 365 causes errors in VBA code for SAS object

    Thanks for doing that... so if your .exe file shows a "L" after the first "PE" occurrence, then it's a 32-bit according to the "easiest method", so it's correct in your case.

  16. #16
    Registered User
    Join Date
    02-04-2021
    Location
    MA, USA
    MS-Off Ver
    2016
    Posts
    20

    Re: Office 365 causes errors in VBA code for SAS object

    so I have asked the IT folks to get the right package of the SAS API Library and I will post an update when available

+ 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. [SOLVED] Excel automation errors with arrays in office 365
    By dentler in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-23-2021, 10:28 AM
  2. [SOLVED] Code not working in Office 2010 and Office 2016
    By amitmodi_mrt in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-21-2016, 02:48 PM
  3. [SOLVED] Strange 'object invoked disconnected' then '1004 - object defined' errors
    By sumdumgai in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-14-2015, 09:48 PM
  4. Moving from Office 2003 to Office 2013 - code no longer works
    By GeorgeC47 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-27-2014, 11:20 AM
  5. [SOLVED] How do i change a VBA code complied on office 2007 Bit 32 to Office 2010 Bit 64
    By nathandavies in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-18-2014, 12:17 PM
  6. errors with Worksheets object
    By bsapaka in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-26-2014, 09:01 PM
  7. Replies: 0
    Last Post: 11-01-2013, 07:39 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