Results 1 to 5 of 5

Thread: making a button invisible

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Jan 2004
    Posts
    908

    making a button invisible

    is it possible to make a button in an excel spreadseet to become invisible from vb6 after calling out the excel template?

  2. #2
    Frenzied Member agmorgan's Avatar
    Join Date
    Dec 2000
    Location
    Lurking
    Posts
    1,383
    Try this. In my case it hides the Paste button.
    VB Code:
    1. MsgBox Application.CommandBars("Standard").Controls(10).Caption
    2.     Application.CommandBars("Standard").Controls(10).Visible = False
    You would need to iterate through the controls until the Caption matched the one you were looking for
    Then set it to false.

  3. #3
    Hyperactive Member
    Join Date
    May 2001
    Posts
    306
    Be carefull though, you'll need to set the button visibility back to true when exiting or it won't show up next time you open Excel. Unless that is your desired effect.

  4. #4

    Thread Starter
    Fanatic Member
    Join Date
    Jan 2004
    Posts
    908
    sorrie...i make a wrong statement...
    the button which i mention comes from the control toolboxin excel (commandbutton1 for eg)...tha t is paste on the sheet.....trying to make it invisible..

  5. #5
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709
    I posted the answer in your VBA Forum thread.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

Posting Permissions

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



Click Here to Expand Forum to Full Width