View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.misc
Stew J[_2_] Stew J[_2_] is offline
external usenet poster
 
Posts: 2
Default Can i open an excel file and print it automaticaly from outloo

Works a treat.

Many thanks
Stew

"Joel" wrote:

from
xlbook.PrintOut
to
xlbook.sheets("Sheet1").PrintOut
or
xlbook.sheets(1).PrintOut

It took me a while to get the right syntax for the OBJECT line. Microsoft
has two different syntax for Macros. the one for excel and the one for other
office products. Try going to help in Outlook but couldn't find the correct
help. finally I went to word and looked up object. found the correct syntax
and it also worked in Outlook.

for microsoft Office
Set xlApp = Application.CreateObject("Excel.Application")
for excel
Set xl = CreateObject("Excel.Sheet")

"Stew J" wrote:

Hi Joel, Thats great thanks, just one more questions at the moment, - if I
wanted to only print 1 sheet of 3 within the book, is there a way to do that?

Thanks
Stew

"Joel" wrote:

This is a question for the programming group in outlook. Below is a macro
that will run from outlook macro (not excel). I don't know how to have
outlook schedule the task (macro) to run weekly.


Sub openexcel()
'Dim wb As excel.workbook

FName = "C:\temp\book1.xls"
Set xlApp = Application.CreateObject("Excel.Application")
Set xlbook = xlApp.Workbooks.Open(FName)
xlbook.PrintOut

End Sub

"Stew J" wrote:

I would like to make excel print a sheet on a weekly basis. the sheet is
part of an accounting file and the results are updated daily. I need the
information to be either printed or saved to my desktop for manual printing
later. This needs to be completed every Monday.