LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Reading from a protected range in Excel

Note: This was originally posted in
microsoft.public.office.developer.automation and got no response. Maybe this
is a better forum for this question?

I have an Excel template that uses VBA code to process data from several
other Excel workbooks.

The embedded VBA code reads data from these other workbooks. For example:

For j = 3 To 14
Set myrange = wb.Worksheets(iETCsht).Range(Cells(11, j), Cells(27, j))
B(j) = Application.WorksheetFunction.Sum(myrange)
Next j

The problem I'm having is sometimes the cells I'm reading from have spaces
instead of numeric data or blanks. When this is the case, the macro displays
either an "Error 400" or "Application defined Error 1004" depending on how
I've configured VBA for error handling. Often these workbooks have password
protected cells so i cant simply fix the offending cells.

I've tried using "On Error Resume Next" to get around this situation but I
still get the errors.

Any thoughts on how I can make my macro code more robust?


 
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
reading range of data from excel sheet in C or C++ asp newbie Excel Programming 0 November 13th 07 11:18 PM
Reading Data From Protected WorkBook [email protected] Excel Programming 4 April 26th 06 04:20 AM
Range.Formula in Excel 2003 gives Error reading formulas just below 1024 bytes Frank Jones Excel Programming 14 July 9th 04 06:25 AM
Reading a Range Pablo Excel Programming 2 June 4th 04 02:59 PM
reading password-protected, open webpage Kevin Excel Programming 7 February 17th 04 09:46 AM


All times are GMT +1. The time now is 10:27 AM.

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

About Us

"It's about Microsoft Excel"