Hi,
Using the Script for VB worked to open multiple .xls files. Now I want to add to the code and Save As Text files with original name.
thx
Technology Tips and News
Hi,
Using the Script for VB worked to open multiple .xls files. Now I want to add to the code and Save As Text files with original name.
thx
Using the Script for VB worked to open multiple .xls files. Now I want to add to the code and Save As Text files with original name.
What script are you referring to?
Please post your entire script and all of your errors. We'll also need a more in depth explanation of what you're trying to do.
Hi,
Using the Script for VB worked to open multiple .xls files. Now I want to add to the code and Save As Text files with original name.
thx
For VB questions post in the VB forum
For Excel VBA issues please post in the Excel developer forums.
Sorry I am new to forums. I used the script on the forum page: http://social.technet.microsoft.com/Forums/en-US/57d8995e-49c0-43af-a637-6102a49a4df1/batch-script-to-open-multiple-excel-and-doc-files?forum=ITCG
strComputer="."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colFileList = objWMIService.ExecQuery _
("ASSOCIATORS OF {Win32_Directory.Name='C:\test'} Where ResultClass = CIM_DataFile")
Set objExcel = CreateObject("Excel.Application")
objExcel.Visible = TRUE
Set objWord = CreateObject("Word.Application")
objWord.Visible = True
For Each objFile In colFileList
If objFile.Extension = "xls" Or objFile.Extension = "xlsx" Then
objExcel.Workbooks.Open objFile.Name
ElseIf objFile.Extension = "doc" or objFile.Extension = "docx" Then
objWord.Documents.Open objFile.Name
End If
Next
This opened all my .xls files in C:\Test folder, and using same code with Close I can close them all too. I want to save each as a text file, before closing. That way I can sort all the .txt files together. As it is now, I open the .xls , SaveAs text, close, repeat.