Results 1 to 2 of 2

Thread: Vba 4605

  1. #1

    Thread Starter
    New Member
    Join Date
    Mar 2004
    Posts
    2

    Vba 4605

    Hi
    I am pretty new to the ASPs. I am developing an application that will be running word document in an IFRAME in an ASP page. When I try to save the contents of the word document, I am getting the error 4605. "The document is in use by another application.". This is working fine in some systems, and some systems throw this error. What should be done in the code to avoid getting this error and saving the document.

    The custom save function is as follows;

    Function save_document()
    Dim wrdApp
    Set wrdApp =Getobject(, "Word.Application")

    If Err.number<>0 Then
    MsgBox("creating word application")
    Set wrdApp = CreateObject("Word.Application")
    else
    MsgBox("getting the existing instance of word")
    End If

    If wrdApp Is Nothing Then Exit Function
    If not (wrdApp.ActiveDocument.ReadOnly = True) Then Err.Number = wrdApp.ActiveDocument.Save
    ActiveDocument.Save
    MsgBox ("Error = " &Err.number & ". " &Err.Description)
    If Err.Number <> 0 Then
    MsgBox "Error saving the Document" , vbInformation, "Saved"
    else
    MsgBox "Section has been saved" , vbInformation, "Saved Successfully"
    End If
    else
    MsgBox "sorry readonly section cannot be saved" ,vbInformation, "Access Denied"
    End if
    Set wrdApp = Nothing
    End Function

    What might be wrong in this code to get the VBA Runtime Error 4605 ?

    Thanks in advance.

  2. #2

    Thread Starter
    New Member
    Join Date
    Mar 2004
    Posts
    2
    Hi

    The problem is, the code works fine in one machine and does throw error 4605 in my machine. What have to be done to make it as machine independent / word settings independent code ?

    Thanks,

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