• Skip to main content
  • Skip to header right navigation
  • Skip to site footer

My Online Training Hub

Learn Dashboards, Excel, Power BI, Power Query, Power Pivot

  • Courses
  • Pricing
    • Free Courses
    • Power BI Course
    • Excel Power Query Course
    • Power Pivot and DAX Course
    • Excel Dashboard Course
    • Excel PivotTable Course – Quick Start
    • Advanced Excel Formulas Course
    • Excel Expert Advanced Excel Training
    • Excel Tables Course
    • Excel, Word, Outlook
    • Financial Modelling Course
    • Excel PivotTable Course
    • Excel for Customer Service Professionals
    • Excel for Operations Management Course
    • Excel for Decision Making Under Uncertainty Course
    • Excel for Finance Course
    • Excel Analysis ToolPak Course
    • Multi-User Pricing
  • Resources
    • Free Downloads
    • Excel Functions Explained
    • Excel Formulas
    • Excel Add-ins
    • IF Function
      • Excel IF Statement Explained
      • Excel IF AND OR Functions
      • IF Formula Builder
    • Time & Dates in Excel
      • Excel Date & Time
      • Calculating Time in Excel
      • Excel Time Calculation Tricks
      • Excel Date and Time Formatting
    • Excel Keyboard Shortcuts
    • Excel Custom Number Format Guide
    • Pivot Tables Guide
    • VLOOKUP Guide
    • ALT Codes
    • Excel VBA & Macros
    • Excel User Forms
    • VBA String Functions
  • Members
    • Login
  • Blog
  • Excel Webinars
  • Excel Forum
    • Register as Forum Member
  • Login

Can help me to run this userform on 64 bit Office|VBA & Macros|Excel Forum|My Online Training Hub

You are here: Home / Can help me to run this userform on 64 bit Office|VBA & Macros|Excel Forum|My Online Training Hub
Avatar
sp_LogInOut Log In sp_Registration Register
sp_Search Search
Advanced Search
Search
Forum Scope




Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
sp_Search Search
sp_RankInfo
Lost password?
sp_CrumbsHome HomeExcel ForumVBA & MacrosCan help me to run this userform on…
sp_PrintTopic sp_TopicIcon
Can help me to run this userform on 64 bit Office
Avatar
Ivaylo Iliev

Active Member
Members
Level 0
Forum Posts: 5
Member Since:
February 25, 2022
sp_UserOfflineSmall Offline
1
February 25, 2022 - 1:14 am
sp_Permalink sp_Print
Need help this to be work on 32 bit and 64 bit office. It is menus in userform. For now it work on 32 bit, but I want to work an on 64 bit, can someone help me to fix it. The problem is when I click on "Show Api Menu" - userfom is appear, but whet I choose any of menus ex: File->NewTask nothing happen.Thank you!
sp_AnswersTopicSeeAnswer See Answer
Avatar
Catalin Bombea
Iasi, Romania
Admin
Level 10
Forum Posts: 1844
Member Since:
November 8, 2013
sp_UserOfflineSmall Offline
2
February 28, 2022 - 4:33 pm
sp_Permalink sp_Print sp_EditHistory

Hi Ivaylo,

The form does not load on my side, this line errors out:

g_lpMyWndProc = SetWindowLong(g_hForm, GWL_WNDPROC, AddressOf HookWinProc) (a data type mismatch error)

That mismatch should be fixed by changing the data type of the arguments for the failing procedure, the form loads now.

I changed this function, the part in red:

Public Declare PtrSafe Function SetWindowLong _
Lib "user32" _
Alias "SetWindowLongA" ( _
ByVal hwnd As Long, _
ByVal nIndex As Long, _
ByVal dwNewLong As LongPtr) _
As Long
Avatar
Velouria
London or thereabouts
Moderator
Members


Trusted Members

Moderators
Level 4
Forum Posts: 688
Member Since:
November 1, 2018
sp_UserOfflineSmall Offline
3
February 28, 2022 - 6:59 pm
sp_Permalink sp_Print

hWnd should also be LongPtr in that code as it's a handle.

sp_AnswersTopicAnswer
Answers Post
Avatar
Ivaylo Iliev

Active Member
Members
Level 0
Forum Posts: 5
Member Since:
February 25, 2022
sp_UserOfflineSmall Offline
4
February 28, 2022 - 9:32 pm
sp_Permalink sp_Print

I make it like you say. The form is appear, but when I try ti choose command nothing happen. Do you know Why?

Avatar
Catalin Bombea
Iasi, Romania
Admin
Level 10
Forum Posts: 1844
Member Since:
November 8, 2013
sp_UserOfflineSmall Offline
5
February 28, 2022 - 11:30 pm
sp_Permalink sp_Print sp_EditHistory

Is there a reason for using this menu in a userform?

You have much better options, you can build a custom menu in ribbon, even in runtime if a dynamic menu is needed.

Will work in a Mac as well, not limited to windows as the current code is.

See: https://docs.microsoft.com/en-.....19a3cc94b5

The available controls can be found in: https://interoperability.blob......UI2%5d.pdf

Avatar
Ivaylo Iliev

Active Member
Members
Level 0
Forum Posts: 5
Member Since:
February 25, 2022
sp_UserOfflineSmall Offline
6
March 2, 2022 - 1:37 am
sp_Permalink sp_Print

I need some like this. 

 

Screenshot-2022-03-01-173204.pngImage Enlarger

sp_PlupAttachments Attachments
  • sp_PlupImage Screenshot-2022-03-01-173204.png (238 KB)
Avatar
Catalin Bombea
Iasi, Romania
Admin
Level 10
Forum Posts: 1844
Member Since:
November 8, 2013
sp_UserOfflineSmall Offline
7
March 2, 2022 - 3:11 am
sp_Permalink sp_Print sp_EditHistory

Screenshot-2022-03-01-190824-1.pngImage Enlarger

Ok, those macros that are called needs to be called only from the form?

They can be called from ribbon, not seeing any reason to use them only in form.

The custom ribbon can be created only for a specific file, but if you want it to show up on every excel file, you have to create the menu on an addin.

See image attached for a custom ribbon.

sp_PlupAttachments Attachments
  • sp_PlupImage Screenshot-2022-03-01-190824-1.png (110 KB)
Avatar
Velouria
London or thereabouts
Moderator
Members


Trusted Members

Moderators
Level 4
Forum Posts: 688
Member Since:
November 1, 2018
sp_UserOfflineSmall Offline
8
March 2, 2022 - 8:14 pm
sp_Permalink sp_Print

This should work on 64bit.

Avatar
Ivaylo Iliev

Active Member
Members
Level 0
Forum Posts: 5
Member Since:
February 25, 2022
sp_UserOfflineSmall Offline
9
March 7, 2022 - 7:38 pm
sp_Permalink sp_Print sp_EditHistory

Thank you it worked but if I want to show another userform and hide menu userform it is bug and close again can I make to show another userform by clicking on menu? Can you tell me how? click on "ShellRun" like example.1-1.PNGImage Enlarger

2-1.PNGImage Enlarger
3-1.pngImage Enlarger
4-1.PNGImage Enlarger
5-1.PNGImage Enlarger

sp_PlupAttachments Attachments
  • sp_PlupImage 1-1.PNG (97 KB)
  • sp_PlupImage 2-1.PNG (338 KB)
  • sp_PlupImage 3-1.png (367 KB)
  • sp_PlupImage 4-1.PNG (303 KB)
  • sp_PlupImage 5-1.PNG (315 KB)
Avatar
Velouria
London or thereabouts
Moderator
Members


Trusted Members

Moderators
Level 4
Forum Posts: 688
Member Since:
November 1, 2018
sp_UserOfflineSmall Offline
10
March 8, 2022 - 4:46 am
sp_Permalink sp_Print

Try moving the code back to the Initialize event, as in the attached version.

Avatar
Ivaylo Iliev

Active Member
Members
Level 0
Forum Posts: 5
Member Since:
February 25, 2022
sp_UserOfflineSmall Offline
11
March 10, 2022 - 3:27 am
sp_Permalink sp_Print

Thank you very much! It working how I expect. Thanks again.

sp_Feed
Go to top
Forum Timezone: Australia/Brisbane
Most Users Ever Online: 245
Currently Online: Philip Treacy, Susan VanRiper, Yiwen Zhou, QSolutions Group
Guest(s) 9
Currently Browsing this Page:
1 Guest(s)
Top Posters:
SunnyKow: 1432
Anders Sehlstedt: 880
Purfleet: 414
Frans Visser: 346
David_Ng: 306
lea cohen: 237
Jessica Stewart: 219
A.Maurizio: 213
Aye Mu: 201
jaryszek: 183
Newest Members:
Herbie Key
Trevor Pindling
Stevan Kanjo
Erin Sheldon
Nikita Bhatia
Sheilah Taylor
Clare Webber
David Jenssen
Dominic Brosnahan
Young You
Forum Stats:
Groups: 3
Forums: 24
Topics: 6526
Posts: 28576

 

Member Stats:
Guest Posters: 49
Members: 32809
Moderators: 2
Admins: 4
Administrators: Mynda Treacy, Philip Treacy, Catalin Bombea, FT
Moderators: Velouria, Riny van Eekelen
© Simple:Press —sp_Information

Sidebar

Blog Categories

  • Excel
  • Excel Charts
  • Excel Dashboard
  • Excel Formulas
  • Excel Office Scripts
  • Excel PivotTables
  • Excel Shortcuts
  • Excel VBA
  • General Tips
  • Online Training
  • Outlook
  • Power Apps
  • Power Automate
  • Power BI
  • Power Pivot
  • Power Query
microsoft mvp logo
trustpilot excellent rating
Secured by Sucuri Badge
MyOnlineTrainingHub on YouTube Mynda Treacy on Linked In Mynda Treacy on Instagram Mynda Treacy on Twitter Mynda Treacy on Pinterest MyOnlineTrainingHub on Facebook

Sign up to our newsletter and join over 400,000
others who learn Excel and Power BI with us.

 

Company

  • About My Online Training Hub
  • Disclosure Statement
  • Frequently Asked Questions
  • Guarantee
  • Privacy Policy
  • Terms & Conditions
  • Testimonials
  • Become an Affiliate
  • Sponsor Our Newsletter

Support

  • Contact
  • Forum
  • Helpdesk - For Technical Issues

Copyright © 2023 · My Online Training Hub · All Rights Reserved. Microsoft and the Microsoft Office logo are trademarks or registered trademarks of Microsoft Corporation in the United States and/or other countries. Product names, logos, brands, and other trademarks featured or referred to within this website are the property of their respective trademark holders.