Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel Macro - Pretty Pretty Please..with cherries on top

Status
Not open for further replies.

rbenak

ISP
Aug 7, 2003
6
US
I need a macro that opens a workbook, refreshes the data(it comes from an external source)sends the wb as an attachment to multiple recipients, then closes.

 
Did you start the coding and are having trouble with it?
 
Yeah, This is what I have...

Sub refresh()
Workbooks.Open "Book2.XLS"
ActiveWorkbook.RunAutoMacros xlAutoActivate

ActiveWorkbook.RefreshAll
ActiveWorkbook.SendMail Recipients:="Richard Benak"

End Sub
 
Have you recorded a Macro and done everything in Excel and then look at the code generated?

Leslie

 
I don't know how to record a macro to have the macro auto run.
 
Don't worry about the auto run yet, go to Tools - Macro - Record New Macro then do all the steps needed to accomplish your goals:

"opens a workbook, refreshes the data(it comes from an external source)sends the wb as an attachment to multiple recipients, then closes"

Once you do all the above, stop the recorder, go to Tools - Macros then edit the macro you just recorded and you will have all the code needed to do the above. then you can worry about getting it to auto open!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top