|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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. |
|
#2
|
|||
|
|||
|
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. |
|
#3
|
||||
|
||||
|
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 |
|
#4
|
|||
|
|||
|
Quote:
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. |
|
#5
|
|||
|
|||
|
A Day Late and a Dollar Short but try this
objXL.ActiveWorkbook.SaveAs "C:\temp1234.xls",FileFormat=xlExcel9795
|
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > Visual Basic Programming > VBScript & Excel - Convert Tab Delimited Files to Excel Files |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|