Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 142
Default "Unable to set the LineStyle property of the border class"

In Excel 2003 I have the following code:

For i = 2 1000 Step 2
Range(i + 1 & ":" & i + 1).Borders(xlEdgeBottom).LineStyle =
xlDouble
Next i

This code fails with the error "Unable to set the LineStyle property of the
border class" for i = 30 and i=128. It works for all the other lines.

Can anyone help me figure out what is going on?

Thanks
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 142
Default "Unable to set the LineStyle property of the border class"

I should have mentioned that after deleting line 30 and 31 it failed only
when i=126 (was 128 before deletion). I have also found that if I right
click on a failing line and select "Format Cells" I get no format menu (or
any other response). Hmm - Now it doesn't seem as if it is a VBA problem.

Also, the For statement was : For i = 2 To 1000 Step 2


On Thu, 03 Jun 2010 12:37:53 -0400, wrote:

In Excel 2003 I have the following code:

For i = 2 1000 Step 2
Range(i + 1 & ":" & i + 1).Borders(xlEdgeBottom).LineStyle =
xlDouble
Next i

This code fails with the error "Unable to set the LineStyle property of the
border class" for i = 30 and i=128. It works for all the other lines.

Can anyone help me figure out what is going on?

Thanks


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default "Unable to set the LineStyle property of the border class"

Can you change the bottom edge for rows 31 and 129 manually?

Ps. I'd use:

For i = 2 TO 1000 Step 2
rows(i + 1).Borders(xlEdgeBottom).LineStyle = xlDouble
Next i

(Maybe even go from 3 to 1001 and use plain old i in that rows(i) portion.)



wrote:

In Excel 2003 I have the following code:

For i = 2 1000 Step 2
Range(i + 1 & ":" & i + 1).Borders(xlEdgeBottom).LineStyle =
xlDouble
Next i

This code fails with the error "Unable to set the LineStyle property of the
border class" for i = 30 and i=128. It works for all the other lines.

Can anyone help me figure out what is going on?

Thanks


--

Dave Peterson
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 142
Default "Unable to set the LineStyle property of the border class"

No - If I right click on those lines or on any cell in those lines and
select "format Cells" I do not get the format dialog. Nothing happens at
all. If I click on any other line or cell all is normal.
On Thu, 03 Jun 2010 14:57:55 -0500, Dave Peterson
wrote:

Can you change the bottom edge for rows 31 and 129 manually?

Ps. I'd use:

For i = 2 TO 1000 Step 2
rows(i + 1).Borders(xlEdgeBottom).LineStyle = xlDouble
Next i

(Maybe even go from 3 to 1001 and use plain old i in that rows(i) portion.)



wrote:

In Excel 2003 I have the following code:

For i = 2 1000 Step 2
Range(i + 1 & ":" & i + 1).Borders(xlEdgeBottom).LineStyle =
xlDouble
Next i

This code fails with the error "Unable to set the LineStyle property of the
border class" for i = 30 and i=128. It works for all the other lines.

Can anyone help me figure out what is going on?

Thanks


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
1004 Error: Unable to set the LineStyle property of the Border class Satish Excel Programming 1 August 27th 09 11:27 AM
Error LineStyle property of Border Class NevilleT Excel Programming 2 November 1st 07 11:28 AM
"Unable to get Pivot Tables Property of Worksheet Class "Error [email protected] Excel Programming 2 April 30th 07 06:18 PM
Interop - "Unable to set the Color property of the Interior class" Elsa Excel Programming 2 August 23rd 06 04:57 AM
"Unable to get the Pivotfieldsd property of the Pivot Class" twaccess[_21_] Excel Programming 1 July 8th 05 01:42 PM


All times are GMT +1. The time now is 04:49 AM.

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"