Workbook Open Trigger executing twice

Workbook Open Trigger executing twice

I have some simple VBA code in the Open trigger for a workbook that increments the open count so I can track how many times a workbook has been opened.  However, it appears that it is being executed twice whenever the workbook is opened, as the count gets incremented by two each time the workbook is opened.  For example, if I set the cell value at 2 then close the workbook, the cell value will be 4 the next time I open the workbook.  Is there a workaround for this?

This is the code:

Private Sub Workbook_Open()

    Dim dashboardSheet As Worksheet
    Dim instructionsSheet As Worksheet
    Dim numOpens As Long

    ' Get references to the sheets
    Set dashboardSheet = ThisWorkbook.Sheets("Dashboard")
    Set instructionsSheet = ThisWorkbook.Sheets("Instructions")

    ' Get the value from cell BG5
    numOpens = dashboardSheet.Range("BG5").Value

    ' Increment the value in cell BG5
    dashboardSheet.Range("BG5").Value = numOpens + 1

End Sub


      Zoho Campaigns Resources


        • Desk Community Learning Series


        • Digest


        • Functions


        • Meetups


        • Kbase


        • Resources


        • Glossary


        • Desk Marketplace


        • MVP Corner


        • Word of the Day


        • Ask the Experts


          Zoho CRM Plus Resources

            Zoho Books Resources


              Zoho Subscriptions Resources

                Zoho Projects Resources


                  Zoho Sprints Resources


                    Zoho Orchestly Resources


                      Zoho Creator Resources


                        Zoho WorkDrive Resources



                          Zoho CRM Resources

                          • CRM Community Learning Series

                            CRM Community Learning Series


                          • Tips

                            Tips

                          • Functions

                            Functions

                          • Meetups

                            Meetups

                          • Kbase

                            Kbase

                          • Resources

                            Resources

                          • Digest

                            Digest

                          • CRM Marketplace

                            CRM Marketplace

                          • MVP Corner

                            MVP Corner




                            Zoho Writer Writer

                            Get Started. Write Away!

                            Writer is a powerful online word processor, designed for collaborative work.

                              Zoho CRM コンテンツ



                                ご検討中の方