Hello,
I use this function to open an existing Excel workbook, clear the contents and paste new data. This has been working great for the most part. The problem is the "ClearContents" is erasing all of my data and formulas and I would like to start at a specific range. Can I specify the range I would like to clear? The data I would like to clear starts at A22:J100.
<BEGIN CODE>
'Open Excel report and clear existing data
Set myXL = CreateObject("Excel.Application")
Set myWB = myXL.Workbooks.Open("O:\WO.xls")
myWB.Sheets("Daily_WO_Report1").UsedRange.ClearContents
myWB.Save
myXL.Quit
Set myXL = Nothing
<END CODE>
Appreciate your help.
I use this function to open an existing Excel workbook, clear the contents and paste new data. This has been working great for the most part. The problem is the "ClearContents" is erasing all of my data and formulas and I would like to start at a specific range. Can I specify the range I would like to clear? The data I would like to clear starts at A22:J100.
<BEGIN CODE>
'Open Excel report and clear existing data
Set myXL = CreateObject("Excel.Application")
Set myWB = myXL.Workbooks.Open("O:\WO.xls")
myWB.Sheets("Daily_WO_Report1").UsedRange.ClearContents
myWB.Save
myXL.Quit
Set myXL = Nothing
<END CODE>
Appreciate your help.