1. F

    Workbook_Open, run macro after cell is selected

    With respect to the event "Workbook_Open", I wanted to call up a macro called Input, which has a relationship with the active cell. The problem is that Workbook_Open may be too early to pick up the active cell. Is there an event which triggers after the workbook is opened and a cell is selected...
  2. AccessShell

    Code behind excel form help

    NOTE: Originally posed elsewhere. I do not believe I will get an answer. I hope I can post it here. I have written some code in Sub Workbook_Open. It works fine. However, I am trying to do two more things. 1. I don't know if I should use Workbook_BeforeClose, Workbook_Deactivate, or...
  3. M

    Excel workbook automatically restores after opening

    I have a workbook that, among other things, minimizes on opening using the VBA command, Application.WindowState = xlMinimizes, in the Workbook_Open macro. This worked for years until recently when it began to restore the workbook window to its last size. The restore happens the moment the...
  4. C

    Workbook_Open() - Call - Call subroutine but does not return

    I am no genius with VB, however I was quite happy with myself when I created a workbook and added under Workbook_Open() four sub-routine's by simply using Call Macro1(), Cal Macro2(), etc. However in my current project file under Workbook_Open(), I start with: Private Sub Workbook_Open Dim...
  5. B

    Code not executing

    Hi all, I use this code to filter data in my workbook; Private Sub Workbook_Open()On Error GoTo Errorhandler Workbooks("Persnlk.xls").Close SaveChanges:=False Workbooks("VB_Macros.xls").Close SaveChanges:=False Worksheets("Shifts").AutoFilterMode = False Worksheets("Shifts").Range("J1:Q" &...
  6. T

    Workbook_Open event won't fire when another window is active

    I've been googling this issue a lot without finding a solution. I have a code in the Workbook_Open event that runs normally when I double click my excel file and wait till it's open. But if I double click hte file and then activate another window (i.e. my internet browser or a file folder)...
  7. rediffusion

    Workbook_Open - how to combine one and more codes?

    Hi all! I duplicate this question because сouldn't find a solution. :( Cross-post is here. :warning: I have in <code style="margin: 0px; padding: 1px 5px; border: 0px; font-variant-numeric: inherit; font-variant-east-asian: inherit; font-stretch: inherit; line-height: inherit; font-family...
  8. P

    Open Referenced Workbook

    I have an Excel Project (Videos.xlsm - project name: videos) which references another Workbook (Series.xlsm - project name: Series). What I would like to do, is open the workbook if its not already open. Is there a way to do it without manually referencing paths or filenames? I already have a...
  9. M

    How to have worksheet_change(byval target by range) to run with workbook_open

    I want to be able to have a workbook do a function when opened. So I want to have a targeted column in a sheet, if a date is 90 days prior to the current date, it will automatically delete the section associated with that date. Example - if today is 4/23/19 and a previous input in a sheet is...
  10. J

    Search specific range for date

    I have a pretty simple request, but getting an error with the range. When the workbook is open, I want to search a specific range ("c2:c15") for any date starting with today and 60 days in the future and popup a msgbox. Below is what I have. Private Sub Workbook_Open() If...
  11. T

    Randomize function

    Following from Rick Rothstein's comment here: he suggests, if I understood him correctly, that you should only ever have the randomize function once. In that case, why not just put it in the Workbook_Open...
  12. G

    Error in WorkBook_Open code: Activate method of Worksheet class failed

    Hi Falks, I have written a code in workbook module in a file with Workbook_Open activity and I am receiving the below error while I am opening the file from sent email or sometimes from main file. Can anyone help me to resolve the below error...
  13. N

    Expanding and collapsing subtotal groups in a protected spreadsheet

    I have a protected spreadsheet (without password) that has subtotals and the associated group levels. These cannot be expanded or collapsed when the sheet is protected. I have found threads that deal with this and advise the following solution: In the code for the sheet, put the following...
  14. D

    Workbook_Open operates inconsistently

    Hello - I have a simple Workbook_Open macro (in the ThisWorkbook module) as follows: Private Sub Workbook_Open() ' Ensure that calculations and screen updating are ON Application.Calculation = xlCalculationAutomatic Application.ScreenUpdating = True ' Leave workbook in working state...
  15. P

    Workbook_Open Issues

    Hi, I want to run two operations through the Workbook_Open string at the same time but can't get it to work correctly. I currently have; Private Sub Workbook_Open() Dim ws As Worksheet For Each ws In ThisWorkbook.Worksheets ws.Visible = xlSheetVisible Next ws Sheets("START").Visible =...
  16. M

    Possible to have a UserForm close by itself?

    For my workbook, I want a 'splash screen' to display immediately after the workbook has been opened. The workbook takes a 10-12 seconds to run a bunch of code when it is first opened, so I want to inform the user that the workbook is loading, so they don't think something is wrong. I created a...
  17. H

    Code not running when workbook opened

    Hi, As per the title, the below code is not executing when I open the workbook. Sometimes it executes as intended and other times it doesn't. Can anyone suggest a reason why and offer a solution please. The workbook has password protection and is used by other people in my workplace so for...
  18. S

    Workbook_Open fires once only the fails to run again.

    EDIT: Missed an 'n' in the subject. Should be 'then fails to run again' I have a WB containing quite a few Subs. Workbook_Open code calls these and was working but it now fails. Trouble-shooting so far: Copy all sheets and code to a new WB and compile code (no issues). a) The Workbook_Open...
  19. M

    Workbook_open code not working

    I was hoping the below would set row height on opening the file, but it doesn't work. Why would this be?? TIA Private Sub Workbook_Open() Sheets("Bedstat").Range([A6], [A65536].End(xlUp)).EntireRow.RowHeight = 13.5 End Sub
  20. G

    Help with vba code placement please

    I have been trying to get this to work in cell "Q4" all morning. I have put it every where in thisworkbook, Legend, and in a new module. Cant get it to work in cell "Q4" of the Legend. This is the formula I am useing. Private Sub Workbook_Open() Sheets("Sheet1").Range("Q4").Value =...

Some videos you may like

This Week's Hot Topics