Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Excel print preview ??
Message
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00876816
Message ID:
00877026
Views:
9
Thanks Yuri,

I'll try that

Peter


>Do you mean, does not allow user to modify, and do not show the sheet itself?
>Then probably this is what you need:
>o.Visible=.t.
>o.ActiveWindow.SelectedSheets.PrintPreview(.f.) && no changes allowed
>o.Visible=.f.
>
>
>>Thanks. Works like a charm
>>now could I make the regular excel window invisble, just show the preview window?
>>
>>
>>Peter
>>
>>
>>>Preview, visible, they should be in revert order, I believe (otherwise excel opens the HIDDEN preview dialog and waits for user action):
>>>o.Visible=.t.
>>>o.ActiveWindow.SelectedSheets.PrintPreview()
>>>
>>>>Hi I want to switch excel to print preview insetad of the normal view
>>>>the following sample code hangs on the printpreview line?
>>>>
>>>>
>>>>LOCAL o as excel.application
>>>>o=CREATEOBJECT('excel.application')
>>>>
>>>>o.Workbooks.Open('G:\vAppsNew\vCPR3\DocDir\ExcelTemplates\ChartofAccountsTemplate.xls')
>>>>oRange=o.Range("A6:E6")
>>>>
>>>>o.ActiveSheet.paste()
>>>>*delete table headers
>>>>o.Range("A6").EntireRow.Delete()
>>>>o.activeWorkbook.SaveAs("PeterCortielAccount")
>>>>*o.ActiveWindow.SelectedSheets.PrintPreview()
>>>>o.Visible=.t.
>>>>
>>>>
>>>>any ideas why
>>>>
>>>>
>>>>Thanks
>>>>
>>>>Peter
Peter Cortiel
Previous
Reply
Map
View

Click here to load this message in the networking platform