×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Excel automation in FoxPro 7

Excel automation in FoxPro 7

Excel automation in FoxPro 7

(OP)
Hello,
I have a situation when I need to format Excel file column(file created programmatically with Excel object) that contains Social Security numbers to be right justified. The problem I have is with SSN with leading zero(s). They are coming out left justified.

Ideally I would like to programmatically format Column as General or Text and set it to have right alignment. I tried to use:

oSheet.RANGE["D","D"].EntireColumn.NumberFormat = "General"
oSheet.COLUMNS("D").EntireColumn.AutoFit

Getting an error on the first line, due to incorrect reference or syntax.

Any help would be appreciated.

Also, is there a decent manual or book or whatever on how to use Excel automation with FoxPro 7?

Igor

RE: Excel automation in FoxPro 7

Try recording a macro in Excel doing what you want to do, and look at the code to see one right syntax. Off the top of my head, you probably need to eliminate "EntireColumn." from that code.

The book Della Martin and I wrote on automating Office should work for you, though of course, all the Office apps have lots more functionality since then: http://www.hentzenwerke.com/catalog/autofox.htm. It's not available in print anymore, but you can buy and download the ebook.

I've also written some articles that might help you get started, but they're not in depth. You'll find my papers at http://tomorrowssolutionsllc.com/conferencepapers....; use the Categories filter to select "Microsoft Office." (Full disclosure: Della wrote the Excel chapters, so my papers tend to focus more on Word.")

Tamar

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login


Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close