Results 1 to 2 of 2

Thread: Cannot close WorkBooks ...

Threaded View

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Feb 2005
    Posts
    115

    Angry Cannot close WorkBooks ...

    I tried other ways of closing it, but it is still in the Tast Manager ...
    It opens it up and that's it ... how the hell do I close it
    I use Microsoft Excel 11.0 Lib.

    here is the code

    VB Code:
    1. Public Sub Check_Validity2()
    2. On Error GoTo NoFile
    3.     Set myBook = Workbooks.Open(strMainFilePath)
    4.     exists = myBook.Worksheets("AH Data").Cells(1, 3).Value
    5.     If exists = "AH1 (AH09-01)" Then
    6.         exists = "true"
    7.     Else: exists = ""
    8.     End If
    9.     myBook.Close savechanges:=False
    10. NoFile:
    11.     If Err.Number = 9 Then
    12.     myBook.Close
    13.     exists = ""
    14.     End If
    15. End Sub
    Last edited by RobDog888; Mar 28th, 2005 at 11:23 PM.

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