>I am trying to do an Excel printout from FoxPro, and your suggestion seems to my solution. However, after executing the "Workbooks.open(myfilepath)" it gave me a syntax error for my printout command. I got the printout syntax from VB Edit, and I can't see why it wouldn't work.
>
>Helen
>
>Here is my exact code
>
>c_fund = "c:\temp\fund.xls"
>oExel = createobject('Excel.application')
>with oExel
> .Workbooks.open(c_fund)
> .ActiveWorkbook.ActiveSheets.PrintOut Copies:=1
> .Quit
>endwith
Helen,
VB macros use 'named arguments' but you need 'positional arguments'. For details about this check Message #
322745 and Message #
343260 They're talking about word but applies to Excel same way.
Your corrected syntax would be :
.ActiveWorkBook.ActiveSheet.PrintOut && Default setting for copies is 1
Cetin