Private Sub Command1_Click()
copyxls "d:\file1.xls"'转换一个文件,遍历你的硬盘上所有xls 文件,调用这个过程
End Sub
Sub copyxls(ByVal sourcexls As String, Optional ByRef targetxls As String)
Dim xlApp As New Excel.Application, xlbook As New Workbook
Set xlApp = CreateObject("Excel.Application")
Set xlbook = xlApp.Workbooks.Open(sourcexls)
targetxls = "e:\" & Trim(xlbook.Sheets(1).Cells(1, 1)) & ".xls" ' copy the file to e:\,change the path to your path
xlbook.SaveCopyAs targetxls
xlApp.Quit
MsgBox "ok"
End Sub