+ Reply to Thread
Results 1 to 2 of 2

in Module require Standard, Formatting & Drawing Toolbar Enable.

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    01-29-2012
    Location
    India
    MS-Off Ver
    Excel 2016
    Posts
    434

    in Module require Standard, Formatting & Drawing Toolbar Enable.

    Hello Sir

    here i m enclosing a my module file with excel sheet.. where we create a newtoolbar in leftpane of sheet..

    my module is working fine but when we run this module by default excel Standard, Formatting & Drawing Toolbar disable... in this case we can't copy any data from other sheet to this sheet..

    We want to Enable Standard, Formatting & Drawing Toolbar with my Newtoolbar pls help me

    My file is enclosed for ur kind persual.

    Thanks in Advance.
    Attached Files Attached Files

  2. #2
    Forum Contributor
    Join Date
    01-29-2012
    Location
    India
    MS-Off Ver
    Excel 2016
    Posts
    434

    Re: in Module require Standard, Formatting & Drawing Toolbar Enable.

    here is my module code

    Sub NTBar()
    On Error Resume Next
    Application.DisplayFullScreen = False
    Application.CommandBars("Misc_Toolbar").Delete
    Set cbrCommandbar = Application.CommandBars.Add
    cbrCommandbar.Name = "Misc_Toolbar"
    cbrCommandbar.Position = msoBarLeft
    With cbrCommandbar.Controls
    Set cbCommandBarButton = .Add
    With cbCommandBarButton
        .Style = msoButtonIconAndCaptionBelow
        .Caption = "&Home"
        .FaceId = 2920
        .Height = 5
        .Width = 60
       .TooltipText = "Go to Home Page"
        .BeginGroup = True
        .Tag = "Back"
        .OnAction = "module1.Home"
    End With
    
    Set cbCommandBarButton = .Add
    With cbCommandBarButton
       .Style = msoButtonIconAndCaptionBelow
       .Caption = "&Entry"
        .FaceId = 64
            .Height = 5
        .Width = 60
        .BeginGroup = True
        .TooltipText = "Enter New Road Data"
        .Tag = "Entry"
        .OnAction = "module1.Entry"
    End With
    
    Set cbCommandBarButton = .Add
    With cbCommandBarButton
       .Style = msoButtonIconAndCaptionBelow
       .Caption = "Ed&it"
        .FaceId = 593
            .Height = 5
        .Width = 60
        .BeginGroup = True
        .TooltipText = "Edit Your Data"
        .Tag = "Edit"
        .OnAction = "module1.Edit"
    End With
    End With
    cbrCommandbar.Visible = True
    cbpCommandbar.Visible = True
    
    End Sub
    
    Public Sub HideAllCommandBars()
        On Error Resume Next
        Application.DisplayFullScreen = False
         For Each objCommandBar In Application.CommandBars
            If objCommandBar.Name = "Misc_Toolbar" Then
            With objCommandBar
            .Visible = True
            .Protection = msoBarNoCustomize
            End With
            Else
            objCommandBar.Visible = False
            
            End If
        Next objCommandBar
        CommandBars("Worksheet Menu Bar").Position = msoBarTop
        ActiveWindow.DisplayVerticalScrollBar = True
        CommandBars("Worksheet Menu Bar").Enabled = True
              
       Call NTBar
        
        ActiveWindow.DisplayWorkbookTabs = False
        ActiveWindow.DisplayHorizontalScrollBar = False
    End Sub
    
    Public Sub UnHideAllCommandBars()
        On Error Resume Next
        Application.DisplayFullScreen = False
        For Each objCommandBar In Application.CommandBars
            If objCommandBar.Name = "Misc_Toolbar" Then
            objCommandBar.Visible = False
            Application.CommandBars(objCommandBar.Name).Delete
            Application.CommandBars(cbpCommandbar.Name).Delete
            Else
            If objCommandBar.Name = "Standard" Then objCommandBar.Visible = True
            If objCommandBar.Name = "Formatting" Then objCommandBar.Visible = True
            If objCommandBar.Name = "Drawing" Then objCommandBar.Visible = True
            End If
        Next objCommandBar
        
        CommandBars("Worksheet Menu Bar").Position = msoBarTop
        ActiveWindow.DisplayVerticalScrollBar = True
       
        CommandBars("Worksheet Menu Bar").Enabled = True
        ActiveWindow.DisplayWorkbookTabs = True
        ActiveWindow.DisplayHorizontalScrollBar = True
         
    End Sub
    
    
    Sub Entry()
    On Error Resume Next
    Sheets("Entry").Visible = True
    Sheets("Entry").Activate
    Range("a6").Activate
    End Sub
    Sub Edit()
    On Error Resume Next
    Sheets("Edit").Visible = True
    Sheets("Edit").Activate
    Range("a6").Activate
    Sheets("Entry").Visible = xlVeryHidden
    End Sub
    
    Sub Home()
    
    Sheets("Home").Visible = True
    Sheets("Home").Activate
    Sheets("Entry").Visible = xlVeryHidden
    End Sub

    How can i enable red color code line all time not conditional.. pls help

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Require Users to Enable Macros
    By Dairy_Queen in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-28-2012, 01:39 PM
  2. Replies: 4
    Last Post: 05-31-2010, 05:33 PM
  3. cant see drawing toolbar
    By Nicky in forum Excel General
    Replies: 10
    Last Post: 05-23-2007, 08:13 AM
  4. drawing toolbar
    By LWright in forum Excel General
    Replies: 0
    Last Post: 08-10-2006, 01:55 PM
  5. Replies: 2
    Last Post: 04-22-2006, 07:20 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1