Hi, I want to write a VBA macro in Word that open an Excel file, save that Excel file to another file (to another name), and then clear all content of the original Excel file. How to do that? Thanks!
Jump to Post
You should try Google as your friend :)
Try the following -
Sub OpenExcelFile() Dim oExcel As Excel.Application Dim oWB As Workbook Set oExcel = New Excel.Application Set oWB = oExcel.Workbooks.Open("C:\Documents and Settings\MyExcelFolderHere\Import.xls") oExcel.Visible = True Set oWB = oExcel.Workbooks.Open(sPath) 'Rest of code End Sub
All 3 Replies
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.