+ Reply to Thread
Results 1 to 4 of 4

Form Show Error

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    01-19-2006
    Posts
    142

    Form Show Error

    Hi all,

    I have the following code in a cmd button on a sheet;

    If r = vbYes Then
                
                ActiveSheet.Unprotect Password:=Pass
                
                Range(Cells(start, 1), Cells(finish, 18)).Select
                Selection.Copy
                Call FindNextEmpty
                ActiveCell.Offset(0, -6).Select
                Selection.PasteSpecial Paste:=xlValues
                
                With Selection.Borders(xlEdgeBottom)
                    .LineStyle = xlDot
                    .Weight = xlThin
                    .ColorIndex = xlAutomatic
                End With
                
                For i = start To finish
                    ActiveSheet.Rows(start).Delete
                Next
                Range("A2").Select
                ActiveSheet.Protect Password:=Pass
                
                frmMain.Show
                
            End If
    Keep getting an error saying 'Invalid Property Value'? any ideas?

  2. #2
    Forum Contributor
    Join Date
    01-19-2006
    Posts
    142
    Hi,

    I have identified that if i do the following code;

            If r = vbYes Then
                
                ActiveSheet.Unprotect Password:=Pass
                
                Range(Cells(start, 1), Cells(finish, 18)).Select
                Selection.Copy
                Call FindNextEmpty
                ActiveCell.Offset(0, -6).Select
                Selection.PasteSpecial Paste:=xlValues
                
                With Selection.Borders(xlEdgeBottom)
                    .LineStyle = xlDot
                    .Weight = xlThin
                    .ColorIndex = xlAutomatic
                End With
                frmMain.Show
                For i = start To finish
                    ActiveSheet.Rows(start).Delete
                Next
                Range("A2").Select
    
                ActiveSheet.Protect Password:=Pass
    
            End If
    the form will then show but the rows will not delete - because a different sheet is activated when the form loads. Why does the form not load when placed under the delete rows loop?

    Any ideas appreciated..

  3. #3
    Forum Contributor funkymonkUK's Avatar
    Join Date
    01-07-2005
    Location
    London, England
    Posts
    500
    Quote Originally Posted by gti_jobert
    Hi,

    I have identified that if i do the following code;

            If r = vbYes Then
                
                ActiveSheet.Unprotect Password:=Pass
                
                Range(Cells(start, 1), Cells(finish, 18)).Select
                Selection.Copy
                Call FindNextEmpty
                ActiveCell.Offset(0, -6).Select
                Selection.PasteSpecial Paste:=xlValues
                
                With Selection.Borders(xlEdgeBottom)
                    .LineStyle = xlDot
                    .Weight = xlThin
                    .ColorIndex = xlAutomatic
                End With
                frmMain.Show
                For i = start To finish
                    ActiveSheet.Rows(start).Delete
                Next
                Range("A2").Select
    
                ActiveSheet.Protect Password:=Pass
    
            End If
    the form will then show but the rows will not delete - because a different sheet is activated when the form loads. Why does the form not load when placed under the delete rows loop?

    Any ideas appreciated..
    do you close the form down?

  4. #4
    Forum Contributor
    Join Date
    01-19-2006
    Posts
    142
    At this point in the application, the form is initialising for the first time.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1