Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default Error: Nonblank cells cannot be shifted off the spreadsheet.

Hi,
I am trying to add a new row to the grid for which
I have a Add button on my page. When i click this add button an error
message pops up as
Error: Nonblank cells cannot be shifted off the spreadsheet..

If i comment the Autofilter part in my onload procedure, i won't get the
error message, but i need this filter for the first row.

Could help me on this?

Sub Window_onLoad()
With objOWC
.ViewableRange = objIntelOWC.ActiveSheet.UsedRange.Address
.Titlebar.caption = "Loading Data..."
.ActiveSheet.Name = "Company"
.DisplayOfficeLogo = False
.DisplayTitleBar = True
.DisplayToolbar = False
.DisplayRowHeadings = True
.DisplayColumnHeadings = False
.DisplayVerticalScrollBar = False
.DisplayHorizontalScrollBar = False
.ActiveSheet.Cells(1,1).value = "Company Code"
.ActiveSheet.Cells(1,2).value = "Company Description"
.ActiveSheet.Rows(1).AutoFilter 'Problem line
.AutoFit = True
.ViewableRange = objIntelOWC.ActiveSheet.UsedRange.Address
.Titlebar.caption = "Done!"
.ActiveSheet.Protection.Enabled = True
End With
End Sub

sub btnAdd_onClick()
dim RowAdd
objOWC.ActiveSheet.Protection.Enabled = False
objOWC.TitleBar.Caption = "Adding Row"
with objOWC
RowAdd = .ActiveSheet.UsedRange.Rows.Count+1
.Rows(RowAdd).insert
.ActiveSheet.UsedRange.Rows.AutoFit
end with
objOWC.TitleBar.Caption = "Done!"
objOWC.ActiveSheet.Protection.Enabled = 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
Error message "cannot shift nonblank cells off the worksheet" CDelphi Excel Discussion (Misc queries) 2 June 15th 09 06:24 AM
can't shift nonblank cells off the page error Adam Excel Discussion (Misc queries) 1 January 30th 07 09:35 PM
tally of nonblank cells AustinMom Excel Worksheet Functions 3 August 31st 06 09:00 PM
Run-time error 1004: Cannot shift nonblank cells off the worksheet [email protected] Excel Discussion (Misc queries) 1 April 10th 06 06:13 PM
Adding NonBlank Cells Emily8 Excel Worksheet Functions 3 January 4th 05 06:16 PM


All times are GMT +1. The time now is 04:59 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"