Print Page | Close Window

Error 438 Object doesn't support this property

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Command Bars
Forum Description: Topics Related to Codejock Command Bars
URL: http://forum.codejock.com/forum_posts.asp?TID=17936
Printed Date: 23 November 2024 at 8:08am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Error 438 Object doesn't support this property
Posted By: Biox
Subject: Error 438 Object doesn't support this property
Date Posted: 22 February 2011 at 4:07am
Thank for reading,

Line 200 is giving me an error as "Error 438 Object doesn't support this property or method"

Appreciate your help as I am sure this was working previously in this project. I've migrated to a new machine and cannot compile this.

thanks



          Dim RibbonBar As RibbonBar
80        Set RibbonBar = CommandBars.AddRibbonBar("The Ribbon")
90        RibbonBar.EnableDocking xtpFlagStretched
100       RibbonBar.ShowQuickAccess = False
         
          Dim ControlFile As CommandBarPopup
          Dim Control As CommandBarControl
          Dim PopupBar As CommandBar
          Dim TabWrite As RibbonTab
         
110       Set ControlFile = RibbonBar.AddSystemButton()
120       ControlFile.IconId = ID_SYSTEM_ICON
130       ControlFile.Caption = "&File"
140       ControlFile.CommandBar.SetIconSize 32, 32
150       With ControlFile.CommandBar.Controls

160           Set Control = .Add(xtpControlButton, ID_FILE_USERS, "&Users")
             
170           Set Control = .Add(xtpControlSplitButtonPopup, ID_FILE_DRIVES, "&Drives")
180           Control.BeginGroup = True
190           Set PopupBar = CommandBars.CreateCommandBar("CXTPRibbonSystemPopupBarPage")

200           Set Control.CommandBar = PopupBar





Replies:
Posted By: Xander75
Date Posted: 22 February 2011 at 4:39am
Hi,

The reason for this issue is due to the way in which you are declaring the variables used!

You are using the "Dim Control As CommandBarControl" therefore you cannot assign the PopupBarCommandBar to this. What you must do is use a variable "Dim ControlPopup As CommandBarPopup" instead.

See the MDI Ribbon sample for this.




-------------
Product: Xtreme SuitePro (ActiveX) v15.3.1
Platform: Windows 7 64-bit (SP1) Professional Edition
Languages: C#.Net using Visual Studio 2012 & Visual Basic 6.0 (SP6)


Posted By: Biox
Date Posted: 23 February 2011 at 7:40pm
Thanks for the reply,

The confusing thing for me is that this was working fine in V11 but has thrown this error when we upgraded to V13.

I have tried the mod as you suggested but now I get Error 13 type mismatch on line 190 per below.

I'll fiddle some more but if you have a thought on this I'd appreciate it.

thanks

          Dim RibbonBar As RibbonBar
80        Set RibbonBar = CommandBars.AddRibbonBar("The Ribbon")
90        RibbonBar.EnableDocking xtpFlagStretched
100       RibbonBar.ShowQuickAccess = False
         
          Dim ControlFile As CommandBarPopup
          Dim Control As CommandBarControl
          Dim PopupBar As CommandBar
          Dim TabWrite As RibbonTab
         
          Dim ControlPopup As CommandBarPopup
         
110       Set ControlFile = RibbonBar.AddSystemButton()
120       ControlFile.IconId = ID_SYSTEM_ICON
130       ControlFile.Caption = "&File"
140       ControlFile.CommandBar.SetIconSize 32, 32
150       With ControlFile.CommandBar.Controls

160           Set Control = .Add(xtpControlButton, ID_FILE_USERS, "&Users")
             
170           Set Control = .Add(xtpControlSplitButtonPopup, ID_FILE_DRIVES, "&Drives")
180           Control.BeginGroup = True
' 190           Set PopupBar = CommandBars.CreateCommandBar("CXTPRibbonSystemPopupBarPage")
190           Set ControlPopup = CommandBars.CreateCommandBar("CXTPRibbonSystemPopupBarPage")

'200           Set Control.CommandBar = PopupBar
200           Set Control.CommandBar = ControlPopup

'210           Set Control = PopupBar.Controls.Add(xtpControlLabel, 0, "Create and DisMount Drives")
210           Set Control = ControlPopup.Controls.Add(xtpControlLabel, 0, "Create and DisMount Drives")






Posted By: Biox
Date Posted: 23 February 2011 at 9:59pm
As an update to this, I have just reinstalled V11.2.2 and recompile fine. Crashes on 13.2.1

The app runs perfectly using 11.2.2. So something fishy is going on  :)



Posted By: Xander75
Date Posted: 24 February 2011 at 3:32am
Hi,

Use this code in v13.2.1 and it will work fine...


    Set ControlPopup = .Add(xtpControlSplitButtonPopup, ID_FILE_PRINT, "&Print")
        ControlPopup.BeginGroup = True
    Set PopupBar = CommandBars.CreateCommandBar("CXTPRibbonSystemPopupBarPage")
    Set ControlPopup.CommandBar = PopupBar


Here it is in your sample code:


    Dim RibbonBar As RibbonBar
    Set RibbonBar = CommandBars.AddRibbonBar("The Ribbon")
    RibbonBar.EnableDocking xtpFlagStretched
    RibbonBar.ShowQuickAccess = False
   
    Dim ControlFile As CommandBarPopup
    Dim Control As CommandBarControl
    Dim PopupBar As CommandBar
    Dim TabWrite As RibbonTab
   
    Dim ControlPopup As CommandBarPopup
   
    Set ControlFile = RibbonBar.AddSystemButton()
    ControlFile.IconId = ID_SYSTEM_ICON
    ControlFile.Caption = "&File"
    ControlFile.CommandBar.SetIconSize 32, 32
   
    With ControlFile.CommandBar.Controls
   
        Set Control = .Add(xtpControlButton, ID_FILE_USERS, "&Users")
          
        Set Control = .Add(xtpControlSplitButtonPopup, ID_FILE_DRIVES, "&Drives")
            Control.BeginGroup = True

        Set ControlPopup = .Add(xtpControlSplitButtonPopup, ID_FILE_PRINT, "&Print")
            ControlPopup.BeginGroup = True
        Set PopupBar = CommandBars.CreateCommandBar("CXTPRibbonSystemPopupBarPage")
        Set ControlPopup.CommandBar = PopupBar

       
        Set Control = ControlPopup.Controls.Add(xtpControlLabel, 0, "Create and DisMount Drives")
    End With


Basically when major versions of software change there may be some changes to the way in which it previously worked. All I did was look at the sample code to get this working!



-------------
Product: Xtreme SuitePro (ActiveX) v15.3.1
Platform: Windows 7 64-bit (SP1) Professional Edition
Languages: C#.Net using Visual Studio 2012 & Visual Basic 6.0 (SP6)


Posted By: Biox
Date Posted: 13 May 2011 at 3:36am
Thank you Xander7,  that fixed the problem for me.





Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net