Porting 32Bit VBA to 64Bit

Red Adair

New Member
Joined
Mar 25, 2021
Messages
7
Office Version
  1. 2019
  2. 2013
Platform
  1. Windows
I am porting 32bit VBA to 64bit and the VBA now generates the following error on two lines of code:
Run-time error '1004': Method 'VBProject' of object '_Workbook' failed

The offending VBA is:
VBA Code:
Application.VBE.MainWindow.Visible = False
I can comment out this code to continue execution where the next line generates the same error.

VBA Code:
Set frmUserForm = ThisWorkbook.VBProject.VBComponents.Add(vbext_ct_MSForm)
frmUserForm is declared as an Object

Any help appreciated
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
That's not a bitness issue. It sounds like you don't have the option set in the macro settings section of the Trust Center to allow trusted access to the visual basic project.
 
Upvote 0
Solution
Thank you RoryA ... I never would have looked in that direction.
 
Upvote 0

Forum statistics

Threads
1,213,489
Messages
6,113,952
Members
448,535
Latest member
alrossman

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top