Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

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

Posted on 2011-09-14
2
596 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

Suggested Solutions

Title # Comments Views Activity
C-ISAM? .dat and .idx file conversion to excel or text 5 3,296
browse dates added less than a month in VFP 4 937
Shortcut keys don't work in VFP9 program. 14 336
Overlay data type 17 100
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…
Most MSPs worth their salt are already offering cybersecurity to their customers. But cybersecurity as a service is wide encompassing and can mean many things.  So where are MSPs falling in this spectrum?
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

840 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