Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old November 9th, 2004, 01:59 PM
deisslem deisslem is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2004
Posts: 2 deisslem User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
VBScript & Excel - Convert Tab Delimited Files to Excel Files

I am trying to write a vbscript that will open a collection of .tsv (tab-delimited) files in Excel, change the formatting of the files (i.e., insert rows, change font size, add column headings, etc.), and then save the files as fully-functional Excel files. At this point, the vbscript I have written will do all of the formatting tasks I require. It will not, however, save the .tsv files as fully-functional Excel files. I’ve tried solutions suggested in the Automating Office Applications section of MSDN’s site without any luck. It seems like I’ll need to modify

objXL.ActiveWorkbook.SaveAs (“filename”)

to specify somehow XLFormat.

I stumbled across this site while searching for a way to accomplish this task and I’m hoping that someone here will be able to help point me to a web site that includes informatino on how to get a vbscript to change the format when saving from Excel. Thanks in advance.

Reply With Quote
  #2  
Old November 9th, 2004, 02:35 PM
THE_ACE THE_ACE is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Location: uk
Posts: 65 THE_ACE User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 36 m 56 sec
Reputation Power: 6
Try This

ActiveWorkbook.SaveAs Filename:="C:\filename.xls", FileFormat:=xlNormal, _
Password:="", WriteResPassword:="", ReadOnlyRecommended:=False, _
CreateBackup:=False

The Ace!!!
Judge Not Less Thee Be Judged Thyself.

Reply With Quote
  #3  
Old November 9th, 2004, 02:36 PM
medialint's Avatar
medialint medialint is offline
Type Cast Exception
Click here for more information.
 
Join Date: Apr 2004
Location: Tralfamadore
Posts: 13,653 medialint User rank is General 51st Grade (Above 100000 Reputation Level)medialint User rank is General 51st Grade (Above 100000 Reputation Level)medialint User rank is General 51st Grade (Above 100000 Reputation Level)medialint User rank is General 51st Grade (Above 100000 Reputation Level)medialint User rank is General 51st Grade (Above 100000 Reputation Level)medialint User rank is General 51st Grade (Above 100000 Reputation Level)medialint User rank is General 51st Grade (Above 100000 Reputation Level)medialint User rank is General 51st Grade (Above 100000 Reputation Level)medialint User rank is General 51st Grade (Above 100000 Reputation Level)medialint User rank is General 51st Grade (Above 100000 Reputation Level)medialint User rank is General 51st Grade (Above 100000 Reputation Level)medialint User rank is General 51st Grade (Above 100000 Reputation Level)medialint User rank is General 51st Grade (Above 100000 Reputation Level)medialint User rank is General 51st Grade (Above 100000 Reputation Level)medialint User rank is General 51st Grade (Above 100000 Reputation Level)medialint User rank is General 51st Grade (Above 100000 Reputation Level)  Folding Points: 307430 Folding Title: Super Ultimate Folder - Level 1Folding Points: 307430 Folding Title: Super Ultimate Folder - Level 1Folding Points: 307430 Folding Title: Super Ultimate Folder - Level 1Folding Points: 307430 Folding Title: Super Ultimate Folder - Level 1Folding Points: 307430 Folding Title: Super Ultimate Folder - Level 1Folding Points: 307430 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 5 Months 2 Weeks 2 Days 4 h 51 m 35 sec
Reputation Power: 4390
Facebook
This should work:

objXL.ActiveWorkbook.SaveAs "c:\myfile.xls", xlNormal
__________________
medialint.com


"Beware of the man who works hard to learn something, learns it, and finds himself no wiser than before. He is full of murderous resentment of people who are ignorant without having come by their ignorance the hard way."
- Vonnegut - Cat's Cradle, 1963

Reply With Quote
  #4  
Old November 9th, 2004, 03:03 PM
deisslem deisslem is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2004
Posts: 2 deisslem User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Quote:
Originally Posted by medialint
This should work:

objXL.ActiveWorkbook.SaveAs "c:\myfile.xls", xlNormal




Medialint,

Thank you for your suggestion. Unfortunately, appending --> , xlNormal <-- to objXL.ActiveWorkbook.SaveAs "c:\myfile.xls" returns an error... SaveAs method of Workbook class failed.

Reply With Quote
  #5  
Old August 19th, 2005, 04:30 PM
erik7426 erik7426 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2005
Posts: 1 erik7426 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 m 40 sec
Reputation Power: 0
A Day Late and a Dollar Short but try this

objXL.ActiveWorkbook.SaveAs "C:\temp1234.xls",FileFormat=xlExcel9795

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming > VBScript & Excel - Convert Tab Delimited Files to Excel Files


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump



 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2009 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway
Stay green...Green IT