![]() |
![]() |
![]() |
|||||
![]() |
![]() |
![]() |
![]() |
![]() |
|||
| Welcome
to Tech Support Forum home to more then 136,000 problems solved. Issues
have included: Spyware, Malware, Virus Issues, Windows, Microsoft,
Linux, Networking, Security, Hardware, and Gaming Getting your
problem solved is as easy as: 1. Registering for a free account 2. Asking your question 3. Receiving an answer Registered members: * See fewer ads. * And much more..
|
| Want to know how to post a question? click here | Having problems with spyware and pop-ups? First Steps |
|
|||||||
| Programming A discussion forum for programs and programming used in tech-related businesses. |
![]() |
|
|
LinkBack | Thread Tools |
|
|
#1 (permalink) |
|
Registered User
Join Date: Jul 2009
Posts: 4
OS: xp
|
vbs help
Hi,
I want to convert a xls to a csv using vb script. So far, I've found a code which does the job if you drag and drop it, but I would like to make it so that I need to run the script by clicking it instead of dragging and dropping and that it'll use a specific file ie.C:\SCRIPTS\TEST.XLS . Please help Code is taken from wiere from go4expert.com Code:
Set objArgs = WScript.Arguments
For I = 0 to objArgs.Count - 1
FullName = objArgs(I)
FileName = Left(objArgs(I), InstrRev(objArgs(I), ".") )
Set objExcel = CreateObject("Excel.application")
set objExcelBook = objExcel.Workbooks.Open(FullName)
objExcel.application.visible=false
objExcel.application.displayalerts=false
objExcelBook.SaveAs FileName & "csv", 23
objExcel.Application.Quit
objExcel.Quit
Set objExcel = Nothing
set objExcelBook = Nothing
Next
|
|
|
|
| Important Information |
|
Join the #1 Tech Support Forum Today - It's Totally Free!
TechSupportForum.com is a leading support website for your computer needs. We offer free, friendly and personalized computer support. Why pay to have your computer fixed when you can do it for free. Join TechSupportforum.com Today - Click Here |
|
|
#2 (permalink) |
|
Registered User
Join Date: Jul 2009
Posts: 4
OS: xp
|
Re: vbs help
never find. i got it
Code:
Set objExcel = CreateObject("Excel.application")
set objExcelBook = objExcel.Workbooks.Open("C:\SCRIPTS\TEST.xls")
objExcel.application.visible=false
objExcel.application.displayalerts=false
objExcelBook.SaveAs "C:\SCIPTS\TEST.csv", 23
objExcel.Application.Quit
objExcel.Quit
Set objExcel = Nothing
set objExcelBook = Nothing
WScript.Echo "Done"
|
|
|
|
![]() |
| Thread Tools | |
|
|