Where did you put the macro? Event macros have to go in the Sheet modules or the ThisWorkbook module. This Workbook_Open event macro belongs in the Thisworkbook module.
If you want to create an Auto_Open macro it belongs in a "standard" module. Then, of course, you must select to "enable macros" when/if prompted when opening the workbook. Paul ----------------------------------------- “Do all the good you can, By all the means you can, In all the ways you can, In all the places you can, At all the times you can, To all the people you can, As long as ever you can.” - John Wesley ----------------------------------------- ________________________________ From: Vijay Kr. Aggarwal <vjaggarwal2...@gmail.com> To: excel-macros@googlegroups.com Sent: Fri, October 26, 2012 6:53:07 AM Subject: Re: $$Excel-Macros$$ Re: A first sheet to be opened always in a excel file Hi Pravin, Please change in first line from workbook to auto. Private Sub auto_Open() ThisWorkbook.Worksheets("test").Activate End Sub regards, Vijay On 10/26/12, Pravin Gunjal <isk1...@gmail.com> wrote: > *Hi Prince,* > * > * > *I tried the code given by you, but it's not working....* > *Please look in to this and inform. Thanks.* > * > * > *Regards* > *Pravin Gunjal. > * > ---------- Forwarded message ---------- > From: Prince <prince141...@gmail.com> > Date: Fri, Oct 26, 2012 at 10:39 AM > Subject: $$Excel-Macros$$ Re: A first sheet to be opened always in a excel > file > To: excel-macros@googlegroups.com > > > Hi Pravin, > > Yes it is possible just copy ansd paste the following code on workbook > open. > > Private Sub Workbook_Open() > ThisWorkbook.Worksheets("test").Activate > End Sub > > > Note: just pass your sheet name instead of test > > Regards > Prince. > > On Friday, October 26, 2012 10:16:16 AM UTC+5:30, Pravin Gunjal wrote: >> >> *Dear Friends,* >> * >> * >> *Greetings!* >> * >> * >> *As usual we do a work in any of the sheets of an Excel and close the >> file as it is after saving. **And I am having an excel file containing >> 5-6 sheets in it and I wants to open only the first sheet always whenever >> I >> open that file.* >> * >> * >> *Is it possible to open always a particular sheet (sheet no.1) while we >> open an excel file.* >> >> *Thanks,* >> *Pravin Gunjal.* >> * >> * >> > -- > Join official facebook page of this forum @ > https://www.facebook.com/discussexcel > > FORUM RULES (1120+ members already BANNED for violation) > > 1) Use concise, accurate thread titles. Poor thread titles, like Please > Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice > will not get quick attention or may not be answered. > > 2) Don't post a question in the thread of another member. > > 3) Don't post questions regarding breaking or bypassing any security > measure. > > 4) Acknowledge the responses you receive, good or bad. > > 5) Cross-promotion of, or links to, forums competitive to this forum in > signatures are prohibited. > > 6) Jobs posting is not allowed. > > 7) Sharing copyrighted ebooks/pirated ebooks/their links is not allowed. > > NOTE : Don't ever post personal or confidential data in a workbook. Forum > owners and members are not responsible for any loss. > --- > You received this message because you are subscribed to the Google Groups > "MS EXCEL AND VBA MACROS" group. > To post to this group, send email to excel-macros@googlegroups.com. > To unsubscribe from this group, send email to > excel-macros+unsubscr...@googlegroups.com. > > -- > Join official facebook page of this forum @ > https://www.facebook.com/discussexcel > > FORUM RULES (1120+ members already BANNED for violation) > > 1) Use concise, accurate thread titles. Poor thread titles, like Please > Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will > not get quick attention or may not be answered. > > 2) Don't post a question in the thread of another member. > > 3) Don't post questions regarding breaking or bypassing any security > measure. > > 4) Acknowledge the responses you receive, good or bad. > > 5) Cross-promotion of, or links to, forums competitive to this forum in > signatures are prohibited. > > 6) Jobs posting is not allowed. > > 7) Sharing copyrighted ebooks/pirated ebooks/their links is not allowed. > > NOTE : Don't ever post personal or confidential data in a workbook. Forum > owners and members are not responsible for any loss. > --- > You received this message because you are subscribed to the Google Groups > "MS EXCEL AND VBA MACROS" group. > To post to this group, send email to excel-macros@googlegroups.com. > To unsubscribe from this group, send email to > excel-macros+unsubscr...@googlegroups.com. > > > -- Regards, Vijay Kumar Aggarwal -- Join official facebook page of this forum @ https://www.facebook.com/discussexcel FORUM RULES (1120+ members already BANNED for violation) 1) Use concise, accurate thread titles. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get quick attention or may not be answered. 2) Don't post a question in the thread of another member. 3) Don't post questions regarding breaking or bypassing any security measure. 4) Acknowledge the responses you receive, good or bad. 5) Cross-promotion of, or links to, forums competitive to this forum in signatures are prohibited. 6) Jobs posting is not allowed. 7) Sharing copyrighted ebooks/pirated ebooks/their links is not allowed. NOTE : Don't ever post personal or confidential data in a workbook. Forum owners and members are not responsible for any loss. --- You received this message because you are subscribed to the Google Groups "MS EXCEL AND VBA MACROS" group. To post to this group, send email to excel-macros@googlegroups.com. To unsubscribe from this group, send email to excel-macros+unsubscr...@googlegroups.com. -- Join official facebook page of this forum @ https://www.facebook.com/discussexcel FORUM RULES (1120+ members already BANNED for violation) 1) Use concise, accurate thread titles. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get quick attention or may not be answered. 2) Don't post a question in the thread of another member. 3) Don't post questions regarding breaking or bypassing any security measure. 4) Acknowledge the responses you receive, good or bad. 5) Cross-promotion of, or links to, forums competitive to this forum in signatures are prohibited. 6) Jobs posting is not allowed. 7) Sharing copyrighted ebooks/pirated ebooks/their links is not allowed. NOTE : Don't ever post personal or confidential data in a workbook. Forum owners and members are not responsible for any loss. --- You received this message because you are subscribed to the Google Groups "MS EXCEL AND VBA MACROS" group. To post to this group, send email to excel-macros@googlegroups.com. To unsubscribe from this group, send email to excel-macros+unsubscr...@googlegroups.com.