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!
amitash
0
Newbie Poster
Recommended Answers
Jump to PostYou 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
To …
All 3 Replies
Reply to this topic
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.