Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to Delete a Range in Closed Workbook
Hi all,
Is it possible to delete a range in a closed workbook, without open it first? Any example would be appreciated. Thanks, Resant |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to Delete a Range in Closed Workbook
You can't do it without opening the workbook, but you can do it without
visibly opening the workbook or seeing that excel is opening. If you are trying to access the workbook from somewhere other than excel, then I would suggest using a VB script file. If you are trying to delete the range from another workbook, then simply use the application.screenupdating = false to prevent people from seeing that you are opening the workbook. Something like this: Sub Macro1() Dim wbSource As Workbook Set wbSource = ActiveWorkbook Application.ScreenUpdating = False 'open the file Workbooks.Open Filename:="C:\My Documents\MyFile.xls" 'delete the range Sheet1.Range("H3:H8").ClearContents 'close the workbook and save ActiveWorkbook.Close True 'restore original workbook as active workbook wbSource.Activate Application.ScreenUpdating = True End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Help - Does value exist in range of CLOSED workbook? | Excel Worksheet Functions | |||
How to Delete a Range in Closed Workbook (to Replace Delete Query) | Excel Discussion (Misc queries) | |||
ADO - closed workbook - Named range | Excel Programming | |||
macro to delete a closed workbook | Excel Programming | |||
Searching a range in Closed Workbook | Excel Programming |