Solved

How do you set a print area for Excel 2007 using VIsual FoxPro?

Posted on 2011-09-14
2
587 Views
Last Modified: 2012-06-27
I can do it using Excel 2003 but I can't define a print area using .PageSetup.PrintArea (it doesn't even show up under ActiveSheet.  Any thoughts?
0
Comment
Question by:djma
2 Comments
 
LVL 27

Accepted Solution

by:
CaptainCyril earned 250 total points
ID: 36540691
I recorded a macro in Excel 2007.

Range("A1:J12").Select
ActiveSheet.PageSetup.PrintArea = "$A$1:$J$12"

Let's say you have oSheet as the object reference to the sheet.
oSheet.PageSetup.PrintArea = "$A$1:$J$12"

When I program automation, I try not to use ActiveWorkbook or ActiveSheet since they might lose reference.
0
 

Author Closing Comment

by:djma
ID: 36543061
It's funny.  I tried what I thought was every permutation but somehow missed.  Regardless, I have it working so thanks!
Doug.
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Microsoft Visual FoxPro (short VFP) is a programming language with it’s own IDE and database, ranking somewhat between Access and VB.NET + SQL Server (Express). Product Description: http://msdn.microsoft.com/en-us/vfoxpro/default.aspx (http://msd…
Knowing where your website is hosted is as important as the features you receive, the monthly fee, and the support you receive. Due diligence should be done when choosing your next hosting provider.
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question