Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]() I have a workbook which is networked. Im trying to include a macro that will automatically run when the workbook is opened in read/write format but will not run when its read only. I understand macro's but aint got a clue on how to do this if it can be done. If it can could I poss have a idiot proof guide. Many Thanks -- tweacle |
#2
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
You could add a single line to the top of your procedu
Option Explicit Sub auto_open() If ThisWorkbook.ReadOnly Then Exit Sub 'your normal code here End Sub (or workbook_open if you used that) tweacle wrote: I have a workbook which is networked. Im trying to include a macro that will automatically run when the workbook is opened in read/write format but will not run when its read only. I understand macro's but aint got a clue on how to do this if it can be done. If it can could I poss have a idiot proof guide. Many Thanks -- tweacle -- Dave Peterson |
#3
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]() at the top menu beside File, there is an excel symbol, right click on that icon and select view codes, Now at the drop down menu where it says general, drop down the menu to select -workbook go to the next drop down menu and select -open beginning and ending code appears put your copy and paste your macro between these two lines of code for example purposes popy and paste this code in between those two lines Dim Msg As String Msg = "This is Dave's great WorkBook!!" MsgBox Msg it will end up looking like this Private Sub Workbook_Open() Dim Msg As String Msg = "This is Dave's great WorkBook!!" MsgBox Msg End Sub Once you have that right then practise butting in the code from your macro Dave -- davesexcel ------------------------------------------------------------------------ davesexcel's Profile: http://www.excelforum.com/member.php...o&userid=31708 View this thread: http://www.excelforum.com/showthread...hreadid=516505 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro giving errors at workbook open | Excel Discussion (Misc queries) | |||
Links only update when external workbook is open | Excel Worksheet Functions | |||
Macro to open print window and set to print entire workbook | Excel Discussion (Misc queries) | |||
Automatically execute a CTRL-ALT-F9 when I open a workbook | Excel Discussion (Misc queries) | |||
Issuing macro in workbook from separate workbook | Excel Discussion (Misc queries) |