Results 1 to 14 of 14

Thread: Object variable or with set variable not set. (resolved)

Threaded View

  1. #6

    Thread Starter
    Fanatic Member
    Join Date
    Jan 2004
    Posts
    908

    Re: Object variable or with set variable not set.

    VB Code:
    1. Function LoadListInExcel() As Boolean
    2. LoadListInExcel= True
    3. Set rstLoadRecord = New ADODB.Recordset
    4. Set xlApp = New Excel.Application
    5. Set xlBook = xlApp.Workbooks.Add
    6. Set xlsheet = xlApp.ActiveSheet
    7. .
    8. .
    9. .
    10. Call setBorder(xlsheet)
    11. Call setColTitleWidth(xlsheet)
    12. End function
    13.  
    14. Private Sub setBorder(worksheet As Excel.worksheet)
    15. With worksheet
    16. .cell...
    17. .range...
    18.  
    19. end with
    20. End Function
    21.  
    22.  
    23. Private Sub setColTitleWidth(worksheet As Excel.worksheet)
    24.  
    25. If lstr <> Trim$(rstLoadRecord![Ready]) Then
    26.                    
    27.  
    28.                    'cut and paste heading
    29.                    .Range("A5:P9").Select
    30.                     [COLOR=Sienna]Selection.Copy[/COLOR]                
    31.                     NextRows = CStr(NextRows + 5)
    32.                    lstrCellCopy = "A" & NextRows
    33.                
    34.                    .Range(lstrCellCopy).Select
    35.                    ActiveSheet.Paste
    36.                    NextRows = CStr(NextRows + 5)
    37.                
    38. End if
    39.  
    40.  
    41.  
    42. End Function

    ...sorry that i miss out those DIM ....Does it got smthing to do with instance..?
    Last edited by RobDog888; Sep 23rd, 2005 at 12:20 AM. Reason: Added vbcode tags

Posting Permissions

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



Click Here to Expand Forum to Full Width