Solved

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

Posted on 2011-09-14
2
566 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
Comment Utility
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
Comment Utility
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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

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…
Learn to move / copy / export exchange contacts to iPhone without using any software. Also see the issues in configuration of exchange with iPhone to migrate contacts.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

728 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now