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

Export Text File to Excel? 1

Status
Not open for further replies.

Ferlin

Programmer
Jan 18, 2001
71
US
Hi All,

I have an application that Exports 5 text files into an Excel Workbook and places them into 5 Worksheets within that workbook. What I need help with is 2 of the 5 worksheets I need to change the orientation on the print to LandScape and also I need to change all 5 worksheets to Fit to Page. Is there a way I can do this in VB with out the user having to do it in Excel?

Any and All help would be appreciated.

Thanks,

Ferlin.
 
I first start recording a Macro in EXCEL, do manually what you want to automate, stop recording, look at the macro and cut 'n paste to my VB, then I strat looking at Docs if needed. BTW, I favor putting the VB code inside a "dummy" Word Document (in my case) which I activate from "real" VB. Once I hve the Document object, I can Call a Main proc in the "duumy" which either does all the work to the other documents or calls embedded VBA code in each e.g.
Call objDocument.PrintYoSelf with applicable parameters which might be Scripting.Dictionaries unloaded to ITEMS and KEYS arrays. I have to print a bunch of New Checking Account Documents and I will not do it in VB nor try to control Word that much from VB.
 
JohnYingling,

Thanks ALOT man don't know how I ever survived with out you. That worked like a charm. My application is almost completed except for a little tweaking here and there, and of course the elusive unending banging away at it and bug searching.

Again Thanks.

Ferlin.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top