Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Sha-auto
here's a reply i sent to a friend the other day with the same question: to run a macro automatically when a workbook opens use the WORKBOOK_OPEN procedure - in the "THISWORKBOOK" module and not stored in a normal macro sheet - to get there .. 1) right mouse click on a sheet tab in your excel workbook and choose view code 2) in the VBE window you should see your workbook's name in bold (& in brackets) on the top left, if not, choose view / project explorer - underneath the workbook's name you should see Sheet1, Sheet2, Sheet3 etc and ThisWorkbook. 3) double click on ThisWorkbook 4) on the right hand side of the screen choose from the left hand drop down "Workbook" and from the right hand one "Open" if it doesn't appear automatically 5) now put your code in here between the Private Sub Workbook_Open() and the End Sub 6) close the VBE window using the X top right hand side. oh, and you also need to set your security (tools / macro / security) settings to medium or low (not recommended) for the macro to work when you open the workbook Hope this helps Cheers JulieD "Sha-auto" wrote in message ... Hi, I need to run a Macro automatically, when I open a file - is this possible ? If so could you let me know how, or steer me in the right direction at least. I couldn't find it in Excel help or on this forum as a question posted previously. I want to open a file from a desktop shortcut and then run the Macro automatically... Many thanks to all you Excel wizards out there, I found some very interesting ideas/solutions when hunting for this answer. -- Sha-auto ------------------------------------------------------------------------ Sha-auto's Profile: http://www.excelforum.com/member.php...o&userid=15704 View this thread: http://www.excelforum.com/showthread...hreadid=272332 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Autorun macro | Excel Discussion (Misc queries) | |||
Excel Macro Issue Trying to autorun Macro Upon Opening Worksheet | Excel Programming | |||
autorun code when opening sheet (not workbook) | Excel Programming | |||
Autorun macro on opening spreadsheet | Excel Programming | |||
autorun macro | Excel Programming |