workbook open event

  1. B

    Open worksheet based on this week's Monday date

    Hi all, I've put together a management information workbook which has a master sheet called 'Performance.' All of the remaining sheets are titled as the Monday of each week with a format ('dd.mm.yy'), i.e. today is 17.05.23, so this week's sheet is called '15.05.23.' I'm looking for code for...
  2. M

    Run VBA When Work Book Opens

    Hi all, I've got the below code which works very well, however, I'd like it to automatically run when the workbook is opened. What do I need to do? Sub SaveAsPDF() Dim fName As String With ActiveSheet fName = .Range("A1") .ExportAsFixedFormat Type:=xlTypePDF, Filename:= _...
  3. D

    Data Input on Workbook Open

    Hey guys, I am trying to implement an input box that appears when the user first opens the workbook. Here is how I would like it to function: User opens the workbook A prompt appears, which asks the user to enter a balance (which is stored as a variable called 'balance') If the user just hits...
  4. R

    Disable AutoSave after 'Enable Content' but Before 'WorkbookOpen'

    Hi all You probably all know the AutoSave in Excel. And probably a lot will know how to disable it with VBA. Sub Workbook_Open() ActiveWorkbook.AutoSaveOn = False End If Situation: When a user is opening this file for the first time, Excel will ask to 'Enable Content' for security...
  5. G

    Workbook to open to a specific sheet and select cell with today's date

    Hi I have a question about the below code: Private Sub Workbook_Open() Dim CellToShow As Range Worksheets("Smart City Projects Schedule").Select x = DateTime.Date Set CellToShow = Worksheets("Smart City Projects Schedule").Rows(6).Find(What:=x, LookIn:=xlValues) If...
  6. B

    WorkBook Open Error

    Hi Guys, I am using the below upon opening the workbook and have assigned both subs to the Workbook and not sheets. everytime i open the workbook i get a run time error 1004 saying that either the macros are disabled or the sub isnt available in this workbook. does anyone know how I could...
  7. B

    VBA Not Running Upon Open.

    Hi Guys, Trying to get the below code running on a new workbook. worked perfectly fine on other one, have entered it in to new workbook and when I open it the code doesnt run. Can anyone help please? Private Sub Workbook_open() Msg = "Would You Like To Book Holidy ? " &...
  8. J

    Display Alerts problem..

    Hello all, So I'm having a bit of trouble understanding Application.DisplayAlerts.... Why can it not stop this error from displaying... I have this in a workbook open event and every time it opens it shows this alert. I also run some code to update my links which is why the alert is even...
  9. J

    Excel 2007 Problem

    Sub coveractive() Dim cover As Worksheet Dim wb As Workbook Set cover = ThisWorkbook.Sheets("Cover") cover.Activate End Sub Private Sub handletemp() Dim wb As Workbook Set wb = Workbooks("Workbook.xlsm") Dim ws As Worksheet Set ws = wb.Sheets("Temporary...
  10. M

    Object Model calls may fail from WorkbookOpen event when exiting Protected View

    I have an excel file that will be opened and accessed by hundreds of people, this file is only accessible through a database program so it is not on a network drive per se. The file has some simple code to hide the ribbon and formula bar, however if the file is opened and trust center settings...
  11. R

    Delete PDF Files from Workbook Folder Based on File Name Length

    I'm attempting to create a macro that runs during the Workbook_Open event which deletes all the PDF files from the directory the workbook is in where the file name has 53 characters before the ".PDF". Any help you could provide me with would be greatly appreciated!
  12. F

    run macro after open workbook

    hi, In module called "total_measures" I have simply code: Sub count_total_measures()Dim wb As Workbook Dim ws As Worksheet Set wb = ActiveWorkbook Set ws = wb.Worksheets("row_data") Dim x_row_data, i, count_measure As Long x_row_data = ws.Cells(Rows.Count, "A").End(xlUp).Row count_measure = 0...
  13. R

    Using multiple macros in one module

    Hi I'm new to VBA so apologies if this is a silly question. I found a useful bit of code that, upon opening the workbook, hides rows on a sheet when they contain no info: Private Sub Workbook_Open() Dim myRng As Range Dim myCell As Range With Worksheets("League Table") Set myRng =...

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top