Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel start up in print preview

Status
Not open for further replies.

LindaRichard

Programmer
Feb 23, 2001
103
CA
Hi,

When programming Excel from VFP 8.0 is there a way
to display a sheet in print preview view on entry instead
of the standard grid sheet?

I also have code to display some text over
serveral columns using the merge command,
this works fine, except that I would like
the row height to adjust to view all of text on entry.
Can this be done?

goExcel.Range("H1:H5").select
goExcel.ActiveCell.FormulaR1C1 = shrimpproj.note
goExcel.Range(lstemp).mergecells=.t.
goExcel.SELECTION.WrapText = .t.

Thanks for your help.
Linda
 
Linda

Providing the sheet is not empty you can use somthing like

Code:
o = CREATEOBJECT("Excel.application")
owb = o.Workbooks.open("c:\book1.xls")
o.Visible = .t.
owb.PrintPreview


Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Mike thanks for your suggestion.

Unfortunately I would need to save the
worksheet first which I don't want to do.
Do you know of any other way to automatically show
the content of the worksheet in print preview?

Thanks again for your help.

Linda
 
Code:
Unfortunately I would need to save the
worksheet first which I don't want to do.
Do you know of any other way to automatically show
the content of the worksheet in print preview?

I believe it works that way by default. Save it to a temp file and delete after.


Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top