Load Userform Office 365 versus older Excel versions

CaptDunsel

New Member
Joined
Aug 2, 2024
Messages
10
Office Version
  1. 365
  2. 2013
Platform
  1. Windows
Have macros designed using Excel 2013. They worked fine until I tried to run on 365 version of Excel. In particular, I use Load Userform, then pass information to the form before showing the userform. Apparently 365 does not allow interaction with the userform until the show command? Is there a good workaround other than using global variables prior to invoking the userform>
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
Hi

I haven't found any particular problems using Excel 365 Beta
 
Upvote 0
Apparently 365 does not allow interaction with the userform until the show command?
I use 365 and can use load statement. Can also set textbox value in initialize event before showing.
 
Upvote 0
Hmm, most confusing. Here is snippet of code from main routine:

Load ufmSelectionTool
ufmSelectionTool.RowSource = rngLookup


This is the Property in the ufmSelectionTool code:
Public Property Let RowSource(ByRef rngSource As Range)
lbxSelection.RowSource = rngSource.Address(0, 0, , 1)
End Property 'RowSource


Under Excel 2013, works fine, when it tries to execute the lbxSelection.RowSource line under 365, I get run time error 91. Is there something I'm overlooking? When I look at Microsoft learn it states this:
Until an object is visible, a user can't interact with it.

Maybe I'm reading too much into the statement and overlooking an obvious error, but if functionality hasn't changed, ssems like the code should work.
 
Upvote 0
I use 365 and can use load statement. Can also set textbox value in initialize event before showing.
The problem isn't in the initialization, that works fine. I have dynamic data to set up the userform that I pass using custom properties that I wrote. When I try to execute through one of those properties, I get error 91 and the ListBox shows as nothing when I examine it in the debugger.
 
Upvote 0
What you quoted makes perfect sense. How can a user interact with something they cannot see? I think if you read the rest of the documentation, somewhere in there it does say that you can interact with it via code. IIRC, 91 means object variable or with block not set? If so, that's telling you that you may have declared an object variable but it contains nothing at the point you attempt to refer to it. Did you port this code into a different workbook? Maybe you left out something.
 
Upvote 0
If you want to post a stripped down version without private information somewhere I will see if it errors on my laptop. If you do, make sure the posted version has the same issue.
 
Upvote 0
What you quoted makes perfect sense. How can a user interact with something they cannot see? I think if you read the rest of the documentation, somewhere in there it does say that you can interact with it via code. IIRC, 91 means object variable or with block not set? If so, that's telling you that you may have declared an object variable but it contains nothing at the point you attempt to refer to it. Did you port this code into a different workbook? Maybe you left out something.
Didn't port to different workbook, simply copied the same workbook onto a different computer. The 'Object' that is not set appears to be the ListBox (lbxSelection) because it shows as 'Nothing' in the debugger.
 
Upvote 0
If you want to post a stripped down version without private information somewhere I will see if it errors on my laptop. If you do, make sure the posted version has the same issue.
Here is snippet of code from main routine:

Load ufmSelectionTool
ufmSelectionTool.RowSource = rngLookup


This is the Property in the ufmSelectionTool code:
Public Property Let RowSource(ByRef rngSource As Range)
lbxSelection.RowSource = rngSource.Address(0, 0, , 1)
End Property 'RowSource


Under Excel 2013, works fine, when it tries to execute the lbxSelection.RowSource line under 365, I get run time error 91.
 
Upvote 0
If you want to post a stripped down version without private information somewhere I will see if it errors on my laptop. If you do, make sure the posted version has the same issue.
I have a "sanitized" version, how do I post the file? Or send it to you?
 
Upvote 0

Forum statistics

Threads
1,221,517
Messages
6,160,264
Members
451,635
Latest member
nithchun

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