Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Problem with Excel
Message
From
08/11/2001 09:20:28
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00578968
Message ID:
00579025
Views:
24
>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
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform