Run a macro when opening a spreadsheet

How or where do I invoke a macro when I open a spreadsheet.
0
1/10/2005 3:01:04 PM
excel.misc 78881 articles. 5 followers. Follow

5 Replies
435 Views

Similar Articles

[PageSpeed] 58

name it autoexec
0
dlw (166)
1/10/2005 3:05:02 PM
Hi Duncan,

In the workbook's ThisWorkbook Module, insert a

          Sub workbook_open()
                    'Your code
           End Sub

macro. To access this module, right-click the Excel icon  to the left of 
"File" on th menu bar, select "View Code".

Alternatively, in a general module, insert a

        Sub Auto_Open
                'Your Code
        End Sub

macro.

If you are unfamiliar with macros, see David McRitchie's Getting Started
 with Macros and User Defined Functions notes at:

        http://www.mvps.org/dmcritchie/excel/getstarted.htm


---
Regards,
Norman



"Duncan Help" <DuncanHelp@discussions.microsoft.com> wrote in message 
news:A7424A32-F259-4FCB-8C1D-E4FBB2DB9499@microsoft.com...
> How or where do I invoke a macro when I open a spreadsheet. 


0
normanjones (1047)
1/10/2005 3:26:48 PM
"Norman Jones" <normanjones@whereforartthou.com> wrote in message
news:ulMO8iy9EHA.2032@tk2msftngp13.phx.gbl...
>  To access this module, right-click the Excel icon  to the left of
> "File" on th menu bar, select "View Code".

This is true if you have your spreadsheet maximized, but if you don't as in
my case, the icon is at the top-left of the spreadsheet, not by the File
menu.


0
bob.phillips1 (6510)
1/10/2005 4:14:36 PM
Hi Bob,

Thank you -  I will expand the instructions in future!


---
Regards,
Norman



"Bob Phillips" <bob.phillips@notheretiscali.co.uk> wrote in message 
news:Oue789y9EHA.3368@TK2MSFTNGP10.phx.gbl...
>
> "Norman Jones" <normanjones@whereforartthou.com> wrote in message
> news:ulMO8iy9EHA.2032@tk2msftngp13.phx.gbl...
>>  To access this module, right-click the Excel icon  to the left of
>> "File" on th menu bar, select "View Code".
>
> This is true if you have your spreadsheet maximized, but if you don't as 
> in
> my case, the icon is at the top-left of the spreadsheet, not by the File
> menu.
>
> 


0
normanjones (1047)
1/10/2005 4:26:28 PM
Been there Norman. I think it was Gord Dibben that corrected me :-)

Bob


"Norman Jones" <normanjones@whereforartthou.com> wrote in message
news:%23kd0SEz9EHA.2676@TK2MSFTNGP12.phx.gbl...
> Hi Bob,
>
> Thank you -  I will expand the instructions in future!
>
>
> ---
> Regards,
> Norman
>
>
>
> "Bob Phillips" <bob.phillips@notheretiscali.co.uk> wrote in message
> news:Oue789y9EHA.3368@TK2MSFTNGP10.phx.gbl...
> >
> > "Norman Jones" <normanjones@whereforartthou.com> wrote in message
> > news:ulMO8iy9EHA.2032@tk2msftngp13.phx.gbl...
> >>  To access this module, right-click the Excel icon  to the left of
> >> "File" on th menu bar, select "View Code".
> >
> > This is true if you have your spreadsheet maximized, but if you don't as
> > in
> > my case, the icon is at the top-left of the spreadsheet, not by the File
> > menu.
> >
> >
>
>


0
bob.phillips1 (6510)
1/10/2005 5:33:07 PM
Reply:

Similar Artilces:

Outlook 2007 unable to open attachments
I have a user running Windows XP Pro, sp3 with Outlook 2007. All has been well. Yesterday she updated her Adobe Reader to v. 9.3 (not sure if that is relevant but pretty suspicous). Now when she receives and email with a .xls attachment she is unable to open it. She gets the message: C:\Documents and Settings\username\Local Settings\Temporary Internet Files\Content.Outlook\F2E0M??\filename.xls could not be found. Check the spelling of the file name, and verify that the file location is correct. I thought perhaps the security folder under Content.Outlook was full, kind of lik...

Keeping Running Totals?
Greeting. I have a spreadsheet that I have created for a flight lo that totals aircraft hours and things like that. The sheet I created is file named flightlog. It has only 1 sheet. I it possible to have excel take that total from lets say Cell A3 of sheet and put it in to Cell A1 of a new file with the same sheet? O take that info and have it automatically create another sheet in th workbook each time I fly and put that info from A3 into A1 of the ne sheet without me having to do anything? If this is possible, when i creates a new sheet, will it automatically give it a new name or wil ...

Automated Macros?
The problem where we are having problems is this: The design team creates a product. Each product has a list of parts : 2 of this 3 of that. No product is the same. The list is then converted to a .csv file, which would then be needed to be converted into labels for each individual part. We would need a macro that would read the quantity of parts requested, make an individual label for each part, but at the same time we would be able to use this macro automated to crate labels for each unique csv file created. Is there anyway that we can "drag and drop" the csv file into a macro a...

Outlook won't open to "outlook Today"
I have Outlook 2002 on Windows XP, and although I set the option to have Outlook open to "Outlook Today", it always opens to the Inbox. Is there a fix for this? Thanks much, pmm-rcd ...

Links cause PowerPoint to freeze when opening
We are trying to move from 2000 to 2007, but there is a massive issue that is preventing us from using 2007. All of our reports are created by linking to excel. This used to work seamlessly in 2000. But now, if you try to open a report in PowerPoint that is linked to excel, you are put through a cycle where powerpoint tries to update every link. Another way to describe this is that PowerPoint and Excel become frozen when PowerPoint is opened and there seems to be no way to bypass the cycle. The time it is frozen increases with every link that is in the report, basically makin...

opening a ppt file and says: there any text converter installed
trying to open a ppt file with pp 2007 it says: can not open because there is any text converter installed. whtat does it mean and how can I solve it??? mofa wrote: >trying to open a ppt file with pp 2007 it says: >can not open because there is any text converter installed. > >whtat does it mean and how can I solve it??? > > It could mean that the power point slide was created using Office 2010 beta or it could also mean that the file you have got is corrupted. The solution is to install Office 2010 beta but this is absolutely not advisable on your o...

Word crashes on opening after changing to Intel
Version: 2008 Operating System: Mac OS X 10.5 (Leopard) Processor: Intel I just ended migrating Office to an iMac intel. Now I cannot open Word. I tried reinstalling Office but the error remains. Here is the repport: Microsoft Error Reporting log version: 2.0 Error Signature: Exception: EXC_BAD_ACCESS Date/Time: 2009-06-17 08:14:45 +0000 Application Name: Microsoft Word Application Bundle ID: com.microsoft.Word Application Signature: MSWD Application Version: 12.1.9.090515 Crashed Module Name: MicrosoftComponentPlugin Crashed Module Version: unknown Crashed Module Offset: 0x000d2607 Blame M...

Open Publish 2007
CONFERENCE PROGRAM AND KEYNOTE PRESENTERS HAVE JUST BEEN ANNOUNCED FOR OPEN PUBLISH 2007. http://www.open-conferences.com/baltimore/sched-at-a-glance.html Open Publish 2007, bringing together professionals from both commercial and enterprise publishing environments to share and exchange industry challenges and solutions. Key topics discussed will be authoring tools and approaches, publishing standards initiatives, single-sourcing data, and content management. March 7-9, 2007, Radisson Plaza Lord Baltimore, Baltimore, Maryland Keynote speakers at this year's event include: Michael Wash, ...

mspub.exe process continues running slowing computer down
Often when I exit Publisher, my computer will slow down dramatically and processor usage will spike to 100%. When I look at the running processes, I notice that mspub.exe is still in the list and it is using 95%+ of the available resources. If I end that task, then everything goes back to normal. This doesn't happen every time I exit Publisher, just every now and then. It is frustrating when it does happen though. ...

IM 9 permission denied errors running integrations
This is not a Dynamics security issue. IM 9 was installed on our new citrix server (running windows 2000 and installed properly under domain admin). My network account can log into the server, then into Dynamics and run any integration. All non-admin network accounts logging into the server, get a permission denied error running a sql optimized integration. If that user creates a new integration and tries to add a destination, they get an error "automation error: could not find the key in the registry." IM was installed using add/remove under administrator, so I am unsur...

Repeat a macro
I have a client using Excel 2000. They have a data sheet with over 9000 lines of information. She basically wants to find, say from column D, every cell that contains the word "bearing" and copy that cell to another worksheet. She has a macro that does the copying, but what she wants to do and I don't know how, is to make it repeat until the job is finished. Any ideas? Thanks! Dino First way involves no macro at all. Click on the top of column D and: Data > Filter > AutoFilter > Custom... > Contains > bearing This will hide the cells in Column D witho...

can't open other users mailbox with "full" rights!
Hi, i can't open another mailbox with my account and on the other mailbox i have in Exchange advanced ==> mailbox rights ==> full mailbox access ON! why is that ? thnx! Phil. Explicit DENY on the ACL of the mailbox for either your account (or most probably for one of the groups you belong to; domains admins, ...) Could also be a problem in the ordering of the ACEs on the object David. "Phil." <anonymous@discussions.microsoft.com> wrote in message news:1214501c44258$f81d1fb0$a101280a@phx.gbl... > Hi, > > i can't open another mailbox with my accoun...

System doesn't recognize that Outlook 2000 is running
I am running Outlook 2000 (Office 2000 with SP-3) on a Sony laptop with Win XP pro. My virus scanner (Avast 4.5) doesn't recognize that Outlook is running and even Microsoft's System Information, when STARTED from Outlook says "Microsoft Outlook 2000 has not been started or is not installed." Outlook runs fine and System Information works fine when started from other Office 2000 programs. I would reinstall, but Microsoft doesn't have an eraser tool that will work with Office 2000 and Win XP. Any ideas where I should look to fix this puzzling problem? Thanks H...

Help! I can't get a spreadsheet to open
Have tried EVERYTHING - it keeps saying that I don't have access - AND I was the one who created it - any suggestions? Excel stores in Windows\Temp(win98) folder a copy(s) of any file that is open. Sometimes this *.tmp file is not deleted from the Temp folder when you close out Excel(maybe a crash of Excel?) or the file, so Excel thinks it is still open and in use. You can try a re-boot and see if that clears it up. If not, after a re-boot, clear out your Windows\Temp folder. If using WinXP your Temp folder would be under user....... Documents and Settings\User\Local Settings...

Opening XLS files from within explorer
We have a problem on one users machine that when they doubleclick on an xls file in explorer or on their desktop the file fails to open. The error messages show that the opening is not reading the full file name - basicaly it is not handling spaces in the file name. If you go in and delete the spaces by remaming the file it all works fine. Anyone got any ideas?? Please Not sure... sounds like Windoze issue? Just a thought... try creating a shortcut to the file, making sure th shortcut name has no spaces, and see if that works -- Message posted from http://www.ExcelForum.com How ab...

Save Macro with date in name
Hi, I have a macro that I want to complete by saveing the file with the current date ate the end of the file name. I have this code but I get an error with the "DateAdd". ActiveWorkbook.SaveAs Filename:="Monthly Accrual Upload" & DateAdd ("MMMM") & " - " & DateAdd ("yyyymmdd") & ".xls", _ FileFormat:=xlText, CreateBackup:=False How can I get the file name for April to be; Monthly Accrual Upload - APRIL - 20101604 Thanks Rick Use Format() as below Msgbox "Monthly Accrual Upl...

Outlook 2000 wont open
If I open and close Outlook 2000 4-5 times during the day, it wont open again. When I click on icon, thinks for 30 seconds but then nothing. If I shut down my computer and restart, all is well for another 4-5 times. Anyone else experience this?? rainman <anonymous@discussions.microsoft.com> wrote: > If I open and close Outlook 2000 4-5 times during the > day, it wont open again. When I click on icon, thinks > for 30 seconds but then nothing. If I shut down my > computer and restart, all is well for another 4-5 times. Check in Task Manager to see if Outlook properly...

minimize workbooks in macro
I have a macro that opens 6 workbooks. I want to minimize 4 of the workbooks and arrange the remaining 2 horizontally. Hi Look at this example: Sub ArrangeWindows() Dim wb As Workbook For Each wb In Application.Workbooks Windows(wb.Name).WindowState = xlNormal Next 'books to minimize Windows("Book1.xls").WindowState = xlMinimized Windows("Book2.xls").WindowState = xlMinimized Windows("Book3.xls").WindowState = xlMinimized Application.Windows.Arrange (xlArrangeStyleHorizontal) End Sub Regards, Per "T Smith" <T Smit...

Opening another user mailbox
I am trying to setup outlook to open another user mailbox in addition to my own. In the Outlook I do this: Tools->Options->Mail Setup->Email accounts->View or Change->Change->More settings->Advanced->Open these additional mailboxes->Add The problem is if the user is not in the GAL - I cannot perform this operation. As soon as I uncheck "Hide from GAL" in the user properties I can open his mailbox. I need to hide user from GAL but still get access to his mailbox. How can I do it? ----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet...

Sales Open Order Report with PROFIT MARGIN
Hi, does anybody knows if it's possible to modify the Sales Open Order Report whith Report Writer to include a field with a Profit Margin? Or is there a way to get the info from the Sales Open Order Report using SmartList? We're using GPv.8.0 Thanks. -- National Packaging Services When using a perpetual inventory method the COGS is not calculated until the Invoice is posted. Therefore the profit margin cannot be determined on an Order. You can use the Current Cost field to estimate, but the amount may change once the Order is transferred to an Invoice and then the Invoice is ...

macro not working #2
I've been trying to get a macro to work. It is a macro that prints the previous week's data on a data sheet. When I click on the macro, I get the message to enter week number. When I do that I get this error message. "run-time error 424" object required when I hit the debug button I get this Sub PrintOut() ' ActiveSheet.Unprotect Set myWeek = Application.InputBox("Select the week number to print", , , , , , , 8) Set myRange = Range(myRange.Offset(0, 6), myRange.SpecialCells(xlLastCell)).EntireColumn.Hidden = True If myRange.Col...

MS Outlook 2003
Using Outlook 2003, I have an excel table in an email. Trying to get "Open in Microsoft Excel 11" by right clicking. Not working on current computer. Worked fine on previous computer. How do I activate this feature? This is taken from "A guide to Microsoft office 2003", Open in Microsoft Excel 11 command Starts Excel and opens the spreadsheet data from an e-mail in a workbook. Found in the menu displayed by right-clicking the spreadsheet data in an e-mail. Thanks, Sonya Please learn how to crosspost instead of multi-posting. Multiposting vs Cro...

using macro to open a workbook
Can anyone help me with creating a macro ? Please. I know how to activate an opened workbook, save and close it using macro. How do I creat a macro that will open a not-yet-open workbook ? I don't mean to use a link. Try something like: Sub OpenABC() Workbooks.Open Filename:="C:\test\abc.xls" End Sub Steve "daniel chen" <danchen@worldnet.att.net> wrote in message news:v2gUb.177029$6y6.3438010@bgtnsc05-news.ops.worldnet.att.net... > Can anyone help me with creating a macro ? Please. > I know how to activate an opened workbook, save and close it using...

opening older publisher files
Hi, probably a FAQ, but anyway. How does one open a older version of a publisher file. A friend has sent me a publisher file and I try to open it publisher says "pulisher can't open older versions of files". Anyway to convert the file? Perhaps import it into word? Send replies to salik-rafiq@myway.com (remove the '-') Salik. Salik, You will need to find out which version they are using and tell us which version you are using. Here is a link that shows which version are compatible: http://www.mvps.org/publisher/versions.html -- Brian Kvalheim Microsoft Publishe...

Custom shortcutmenu for commandbutton to open form with arguments
How does one create a custom shortcutmenu to set to a CommandButton that will open up a form passing in arguments from the current form, all in Access 2007 and VBA? Attached is some code that I use for a custom shortcut menu that I use on most of my forms. I call the subroutine when my Splash screen loads, and then use the click event of a control on my form (usually a label in the upper left corner of the form) to display the shorcut menu, using: CommandBars("MyFormMenu").ShowPopup What you will need to do is change the references to fnCloseForm to a new function th...