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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Error setting EXCEL Page Orientation via COM

Status
Not open for further replies.

SteveShanks

Programmer
Nov 28, 2001
112
GB
Hi All

I have some code that creates an instance of Excel, adds a new workbook and sheet and then sets the orientation of the page to Potrait.

This is built on a machine with Office 2000 and the project has references to Excel Library 9 (Excel 2000) and works on various combinations of Office including 2000, 2002, 2003 etc but on one Windows 2000 Pro/Excel 2000 machine it gives the following error:

"QueryInterface for interface Excel.PageSetup failed."

Does anyone know what could be causing this, I can't find much about it on the web.

Thanks
Steve
 
Hi

We have patched office a bit and it seems to have got past the Page Orientation area but now errirs with 'Bad variable Type' when assigning a string to a cell.

Plan is to remove office and reinstall and take it from there.

Thanks
Steve
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top