Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help - Does value exist in range of CLOSED workbook? c mateland Excel Worksheet Functions 9 April 16th 07 06:53 PM
How to Delete a Range in Closed Workbook (to Replace Delete Query) [email protected] Excel Discussion (Misc queries) 1 March 8th 06 10:10 AM
ADO - closed workbook - Named range MattShoreson[_16_] Excel Programming 2 August 31st 05 10:37 AM
macro to delete a closed workbook Tim Excel Programming 1 June 30th 05 07:57 AM
Searching a range in Closed Workbook TroyH[_3_] Excel Programming 5 April 9th 04 02:21 PM


All times are GMT +1. The time now is 05:13 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"