>Hi All,
>I have developed an application in VFP5 on a win98 platform. One of its functions is to write to an excel file - CreateObject etc etc..
>
>On my machine in both the development and exe environment all works ok. However when I tested on the users machine as soon as it starts excel I get the error message:
>
>OLE IDispath exception Code 1004 from Microsoft Excel. Unable to Set the PrintQuality property of the PageSetUp Class!
>
>Does anyone have any ideas please! Both machines are running the same version of win98 and excel.
>
>* CODE SNIPPET IS AS FOLLOWS
>if isnull(loXl)
> loXl = CreateObject('Excel.Application')
>endif
>if isnull(loXl)
> =messagebox('Could not start Excel application - Electronic Pro_Forma not created!',64,'Unable to Start XL')
> select (nSelect)
> return .t.
>endif
>
>#Define msoTextOrientationHorizontal 1
>#Define msoTrue .T.
>
>with loXl
> .Workbooks.Add && Add a New One
>* Format The Cells
>
> .Columns("A:A").Select
> .Selection.ColumnWidth = 19.43
> With loXL.Selection.Font
> .Name = "Arial"
> .Size = 9
> .Strikethrough = False
> .Superscript = False
> .Subscript = False
> .OutlineFont = False
> .Shadow = False
> .Underline = xlUnderlineStyleNone
> .ColorIndex = xlAutomatic
>ETC.......
Derek,
I couldn't see worksheet object but assume it's right (working on your environment). PrintQuality is printer driver dependant and might return error (as documented).
Cetin