2

I've ran into a problem I can't fix.. I use VBA 7.1 in Autodesk Inventor 2017. During a macro, a Userform is being called. I use 'UserForm_Initialize()' to fill some data in to the UserForm: I fill up a listbox, change some labelcaptions, and position and resize some controls. The UserForm gets resized by the height of a listbox on the form with this code:

HeightListbox = 12.7 + MaxRows * 12.7

ListBoxSelectiParts.Height = HeightListbox
UserFormSelectiParts.Height = HeightListbox + 80
CommandButtonOK.Top = HeightListbox + 22
CommandButtonCancel.Top = HeightListbox + 22

The strange thing is, I've tested this on about 5 PC's and it works great, except for 1 PC.. On that PC the all data is being filled in, the control resizing an repositioning is done, except for the listbox.height! When I create a different button and hard code it with

ListBoxSelectiParts.Height = 300

It works, but it doesn't during the initialize.. Again, this works on all other PC's at my office.. All PC's are Windows 7 64bits. I noticed a difference in built versions with some PC's, but 2 PC's have the same built version as the problem PC and the code does work on those PC's..

Does anybody have a clue?

Thanks in advance

braX
  • 11,506
  • 5
  • 20
  • 33
Majjek
  • 41
  • 3
  • did you try a reboot? – ashleedawg Mar 06 '18 at 16:07
  • Sounds like there is a setting in AutoDesk that is inhibiting the initialize call. It could be a security setting. – HackSlash Mar 06 '18 at 18:25
  • Thanks for the reactions. I've done multiple reboots (I've been struggling with this for a week now :) ). If it can be a security setting, isn't it the strange that all the other controls get resized and moved in the Initialize call? – Majjek Mar 07 '18 at 09:16

1 Answers1

1

I have included the listbox (making the listbox high enough) into a frame. Then, simply change the frame´s height. I put the frame's BorderStyle property in 0=fmBorderStyleNone