Results 1 to 8 of 8

Clicking on a button linked to VBA code fails to execute

Threaded View

  1. #1
    Forum Contributor
    Join Date
    12-03-2021
    Location
    Brussels
    MS-Off Ver
    Microsoft 365
    Posts
    186

    Clicking on a button linked to VBA code fails to execute

    Dear,

    Please check the file attached, and have a look at the worksheet "GENERAL".

    There is a button called "OFFRE" which is linked to :

    1) the below subroutine in the worksheet "GENERAL" to define the preconditions of the button's execution

    'Define the top-right button for Offre
    Sub BoutonOffre_Click()
        Sheets("GENERAL").Range("E1").Value = "Offre"
        Sheets("OFFRE DE PRIX").Range("A6").Select
    End Sub
    2) the below module to show or hide certain tabs depending on the value defined in the above routine.

    Sub ShowHideTabsOffre(ByVal Target As Range)
    
        'Show or hide tabs depending on the document type
        
        If Target.Address = "$E$1" Then
            
            Select Case Target.Value
            
                Case "Offre"
                    
                    Worksheets("OFFRE DE PRIX").Visible = xlSheetVisible
                    Worksheets("GENERAL").Visible = xlSheetHidden
                    Worksheets("CAHIER DES CHARGES").Visible = xlSheetVisible
                    Worksheets("CONDITIONS GENERALES").Visible = xlSheetVisible
    
            End Select
        
        End If
    
    End Sub
    However, when I click on the button, there is a "400" error without any additional message or warning. I can't figure what is the issue.

    (If needed, password: 9583)

    Can someone help me please? Thanks
    Attached Files Attached Files
    Last edited by jeriss; 01-19-2023 at 09:52 AM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. run code once a time when clicking the run button
    By pmchris in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-20-2020, 11:18 PM
  2. Clicking a FORM CONTROL Button using VBA code.
    By ayush_9924 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-12-2015, 12:47 AM
  3. code to execute a keyboard shortcut or to execute a toolbar button
    By Gti182 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-09-2015, 12:16 PM
  4. How To execute a button (click event) with code?
    By jamiguel77 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-23-2014, 11:22 AM
  5. Code to clear check box fails to execute
    By brharrii in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-18-2013, 03:51 PM
  6. How to find the VBA code of a button without clicking it??
    By techcrium in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-19-2012, 02:36 PM
  7. [SOLVED] How can I use VB code to execute macro when double-clicking cell?
    By JDay01 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 06-13-2006, 10:20 AM

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