Dim xlApp, xlWkb, SourceFolder, TargetFolder, file Set xlApp = CreateObject("excel.application") Set fs = CreateObject("Scripting.FileSystemObject") Const xlNormal = 1 SourceFile = "ALDEALSPOT_?????.xls" '<== ****EDIT THIS**** SourceFolder = "C:\Temp\xml\" & SourceFile '<== ****ONLY EDIT THE FOLDER LOCATION**** TargetFolder = "C:\Temp\xls" ' <== ****EDIT THIS**** xlApp.Application.DisplayAlerts = False 'Hide Excel xlApp.Visible = False 'Open file in SourceFolder Set xlWkb = xlApp.Workbooks.Open(SourceFolder) 'Concatenate full path. Extension will be automatically added by Excel FullTargetPath = TargetFolder & "\" & SourceFile 'Save as XLS file into TargetFolder xlWkb.SaveAs FullTargetPath, xlNormal 'Saves in xls 'xlWkb.SaveAs FullTargetPath, xltext ' Saves in txt 'Close file xlWkb.Close 'Next Set xlWkb = Nothing Set xlApp = Nothing Set fs = Nothing
|Need to insert text into a IMAGE field as Double Byte from vbscript into SQL table||10||42|
|how to open a file with any name (*) and specific extension in VB||1||24|
Join the community of 500,000 technology professionals and ask your questions.
Connect with top rated Experts
19 Experts available now in Live!