Page 1 of 2 12 LastLast
Results 1 to 15 of 16
  1. #1
    rankhornjp is offline Advanced Beginner
    Windows Vista Access 2007
    Join Date
    Jul 2011
    Posts
    46

    Problem with new computer running Word 2013

    The access database was created with Access 2007. Most of my computers are running Office 2007. However, I just purchased a new computer that is running Office 2013 (home and business). I have tried Access Runtime 2007, Runtime 2013, and installed a stand alone copy of Access 2007 trying to fix this issue.



    The Issue:

    I have several buttons on a form that are used to populate word documents. The word documents are on a network drive. The word documents were created in Word 2007 and uses form fill boxes to receive the information. The documents are protected to allow form fill only.

    Here is the code:
    Code:
    Private Sub printForm()
    'Open up form and fill it in with information from database.
    
    
    Dim appWord As Word.Application
    Dim doc As Word.Document
    
    
    
    
    
    
    'Avoid error 429, when Word isn't open.
    On Error Resume Next
    Err.Clear
    
    
    'Set appWord object variable to running instance of Word.
    Set appWord = GetObject(, "Word.Application")
    If Err.Number <> 0 Then
    
    
    'If Word isn't open, create a new instance of Word.
    Set appWord = New Word.Application
    End If
    
    
    MsgBox btn
    
    
    'If word isn't open, determine which instance to create
    If btn = 1 Then
        Set doc = appWord.Documents.Open("\\DUI_NAS\data\redirect\11documents\dataforms\DUIContractSignUP.docm", , True)
    End If
    
    
    If btn = 2 Then
        Set doc = appWord.Documents.Open("\\DUI_NAS\data\redirect\11documents\dataforms\DefensiveDrivingSignUp.docm", , True)
    End If
    
    
    If btn = 3 Then
       Set doc = appWord.Documents.Open("\\DUI_NAS\data\redirect\11documents\dataforms\CE Summary LR.docx", , True)
    End If
    
    
    If btn = 4 Then
       Set doc = appWord.Documents.Open("\\DUI_NAS\data\redirect\11documents\dataforms\CE Computer Forms LR.docx", , True)
    End If
    
    
    If btn = 5 Then
        Set doc = appWord.Documents.Open("\\DUI_NAS\data\redirect\11documents\dataforms\SA Assessment.docx", , True)
    End If
    
    
    If btn = 6 Then
        Set doc = appWord.Documents.Open("\\DUI_NAS\data\redirect\11documents\dataforms\DV Assessment.docx", , True)
    End If
    
    
    If btn = 7 Then
        Set doc = appWord.Documents.Open("\\DUI_NAS\data\redirect\11documents\dataforms\AM Assessment.docx", , True)
    End If
    
    
    If btn = 8 Then
        Set doc = appWord.Documents.Open("\\DUI_NAS\data\redirect\11documents\dataforms\SL Assessment.docx", , True)
    End If
    
    
    If btn = 9 Then
        Set doc = appWord.Documents.Open("\\DUI_NAS\data\redirect\11documents\dataforms\SA Contract.docx", , True)
    End If
    
    
    If btn = 10 Then
       Set doc = appWord.Documents.Open("\\DUI_NAS\data\redirect\11documents\dataforms\CE Computer Forms JR.docx", , True)
    End If
    
    
    If btn = 11 Then
       Set doc = appWord.Documents.Open("\\DUI_NAS\data\redirect\11documents\dataforms\CE Summary JR.docx", , True)
    End If
    
    
    MsgBox "Step 2"
    
    
    With doc
    .FormFields("firstName").Result = Me!pFname
    .FormFields("lastName").Result = Me!pLname
    .FormFields("middleName").Result = Me!pMi
    .FormFields("streetAddress").Result = Me!pAddress1
    .FormFields("cityAddress").Result = Me!pCity
    .FormFields("stateAddress").Result = Me!pState
    .FormFields("zipAddress").Result = Me!pZip
    .FormFields("numberHome").Result = Me!pPhone1
    .FormFields("numberCell").Result = Me!pPhone2
    .FormFields("SSN").Result = Me!pSSN
    .FormFields("dateBirth").Result = Me!pDOB
    .FormFields("licenseNumber").Result = Me!pDLNumber
    .FormFields("race").Result = Me!pRace
    .FormFields("sex").Result = Me!pSex
    .FormFields("DUI1").Result = Me!pDUI1
    .FormFields("DUI2").Result = Me!pDUI2
    .FormFields("DUI3").Result = Me!pDUI3
    .FormFields("DDClassDate").Result = Me!pDDClassDate
    .Visible = True
    .Activate
    
    
    End With
    
    
    MsgBox "Step 3"
    
    
    Set doc = Nothing
    Set appWord = Nothing
    
    
    MsgBox "Step 4"
    
    
    Exit Sub
    
    
    errHandler:
    MsgBox Err.Number & ": " & Err.Description
    
    
    
    
    End Sub
    All the computers that are running Office 2007 work fine. You click the button, the word doc opens and the text boxes are populated.

    On the new computer, when I click a button it acts like its going to work (i get the "O" new to the mouse pointer) but the word doc never opens.

    I've added message boxes throughout the code to help with trouble shooting and I get all 4 message boxes when I click a button and the first message displays the correct btn #.

    Suggestions?

  2. #2
    Dal Jeanis is offline VIP
    Windows 7 32bit Access 2010 32bit
    Join Date
    May 2013
    Location
    Dallas TX
    Posts
    1,742
    1) I generally prefer to use a case statement instead of 12 distinct If's.
    Code:
    Select Case btn
       Case 1
       Set doc = appWord.Documents.Open("\\DUI_NAS\data\redirect\11documents\dataforms\DUIContractSignUP.docm", , True)
       Case 2
       Set doc = appWord.Documents.Open("\\DUI_NAS\data\redirect\11documents\dataforms\DefensiveDrivingSignUp.docm", , True)
       Case 3
       Set doc = appWord.Documents.Open("\\DUI_NAS\data\redirect\11documents\dataforms\CE Summary LR.docx", , True)
       Case 4
       Set doc = appWord.Documents.Open("\\DUI_NAS\data\redirect\11documents\dataforms\CE Computer Forms LR.docx", , True)
       Case 5
       Set doc = appWord.Documents.Open("\\DUI_NAS\data\redirect\11documents\dataforms\SA Assessment.docx", , True)
       Case 6
       Set doc = appWord.Documents.Open("\\DUI_NAS\data\redirect\11documents\dataforms\DV Assessment.docx", , True)
       Case 7
       Set doc = appWord.Documents.Open("\\DUI_NAS\data\redirect\11documents\dataforms\AM Assessment.docx", , True)
       Case 8
       Set doc = appWord.Documents.Open("\\DUI_NAS\data\redirect\11documents\dataforms\SL Assessment.docx", , True)
       Case 9
       Set doc = appWord.Documents.Open("\\DUI_NAS\data\redirect\11documents\dataforms\SA Contract.docx", , True)
       Case 10
       Set doc = appWord.Documents.Open("\\DUI_NAS\data\redirect\11documents\dataforms\CE Computer Forms JR.docx", , True)
       Case 11 
       Set doc = appWord.Documents.Open("\\DUI_NAS\data\redirect\11documents\dataforms\CE Summary JR.docx", , True)
    End If

    2) Try this - comment out these lines
    Code:
    Set doc = Nothing
    Set appWord = Nothing
    I'm suspicious about destroying the reference to the document and the word application. It shouldn't cause the created Word application to close, and cleanup at the end of the subroutine should destroy those references when they go out of scope anyway, but the code snippets I found around the internet have not included explicitly destroying the references.

  3. #3
    Dal Jeanis is offline VIP
    Windows 7 32bit Access 2010 32bit
    Join Date
    May 2013
    Location
    Dallas TX
    Posts
    1,742
    Another thing that you can test - copy the documents to a folder on the new machine, and change the code to refer to the local copy. If that fixes it, you have an operating system or premissins problem.

    If not, then remove the "True" from the third parameter of the open and see if that fixes it. (Do this when the code is pointing to the local copy). This will test whether the new machine is interpreting the "ReadOnly" parameter in some adverse way.

  4. #4
    rankhornjp is offline Advanced Beginner
    Windows Vista Access 2007
    Join Date
    Jul 2011
    Posts
    46
    Neither suggestion changed anything.

    I removed "On Error Resume Next" and got this error:

    Run-Time Error
    2147221163(80040155)
    Automation Error
    Interface not registered

  5. #5
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows XP Access 2003
    Join Date
    Aug 2013
    Posts
    7,862
    Found this on the world wide web

    http://support.microsoft.com/kb/241637

  6. #6
    Dal Jeanis is offline VIP
    Windows 7 32bit Access 2010 32bit
    Join Date
    May 2013
    Location
    Dallas TX
    Posts
    1,742
    Googling that error message came back with this - http://support.microsoft.com/kb/948463

    Cause : Microsoft Office 2007 was previously installed on the computer, and has since been uninstalled. Uninstalling Microsoft Office 2007 removes the following registry keys which define the Visual Basic Collection interface.

    [HKEY_CLASSES_ROOT\Interface\{A4C46780-499F-101B-BB78-00AA00383CBB}]

    [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Interface\{A4C 46780-499F-101B-BB78-00AA00383CBB}]
    I'd suggest checking all the references on the new machine. This thread also has lots of interesting diagnostic coments and conjectures. http://answers.microsoft.com/en-us/o...3-69c4df1e79fc

  7. #7
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows XP Access 2003
    Join Date
    Aug 2013
    Posts
    7,862
    Based on the error msg. I tend to believe the problem is on the client machine. I do not know if this is a split DB or not. Creating an FE that contains a freshly rebuilt version of the procedure may be an option. I would probably explore the security thing with the existing word templates first. It kinda goes hand in hand with the error msg/client relationship thing.

    I am wondering if the word docm file is looking for security authentication in an office folder that does not exist on a client machine that does not have these folders. Even if Access 2007 RT is installed, it does not create WORD Office12 folders. It will only create office12 folders relevant to Access RT 2007.

    Perhaps an option is to try and create or duplicate the word templates in the new version and then create the security policy. Testing the backward compatibility of the security feature is where I would start. Creating the security policy in Word 2013 may shed some light in the issue.

    Ultimately, you may need a custom procedure for machines with newer versions of Word. A procedure that has a path to a docm that is of the 2013 flavor. You would probably need to follow through with the appropriate library reference within the VBA editor, or maybe not if late binding is an option.

  8. #8
    rankhornjp is offline Advanced Beginner
    Windows Vista Access 2007
    Join Date
    Jul 2011
    Posts
    46
    I installed a copy of Word 2007 that I had and it corrected the problem. (I don't understand why) It now operates as it should.

  9. #9
    Dal Jeanis is offline VIP
    Windows 7 32bit Access 2010 32bit
    Join Date
    May 2013
    Location
    Dallas TX
    Posts
    1,742
    As suggested by the quote in post #6, seems like ***something*** had hosed up the registry, and installing word 2007 restored the lost references. Good job!

  10. #10
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows XP Access 2003
    Join Date
    Aug 2013
    Posts
    7,862
    Quote Originally Posted by rankhornjp View Post
    I installed a copy of Word 2007 that I had and it corrected the problem. (I don't understand why) It now operates as it should.
    Where did you install 2007?

  11. #11
    rankhornjp is offline Advanced Beginner
    Windows Vista Access 2007
    Join Date
    Jul 2011
    Posts
    46
    Quote Originally Posted by ItsMe View Post
    Where did you install 2007?
    On the new computer.

  12. #12
    rankhornjp is offline Advanced Beginner
    Windows Vista Access 2007
    Join Date
    Jul 2011
    Posts
    46
    Quote Originally Posted by Dal Jeanis View Post
    As suggested by the quote in post #6, seems like ***something*** had hosed up the registry, and installing word 2007 restored the lost references. Good job!
    That post is what gave me the idea to try installing Word 2007. Like I said, I don't understand why/how, but I'm glad it works!

  13. #13
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows XP Access 2003
    Join Date
    Aug 2013
    Posts
    7,862
    So ummm, this is the computer with Office 2013? It is surprising to you that having office 2007 installed allows you to run the code? Didn't you state that the code works on machines with Office 2007?

  14. #14
    rankhornjp is offline Advanced Beginner
    Windows Vista Access 2007
    Join Date
    Jul 2011
    Posts
    46
    Quote Originally Posted by ItsMe View Post
    So ummm, this is the computer with Office 2013? It is surprising to you that having office 2007 installed allows you to run the code? Didn't you state that the code works on machines with Office 2007?
    I didn't install Office 2007, only Word 2007. So, now the new computer is running Office Home and Business 2013, Word 2007, and Access Run-time 2013.

  15. #15
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows XP Access 2003
    Join Date
    Aug 2013
    Posts
    7,862
    Quote Originally Posted by rankhornjp View Post
    I didn't install Office 2007, only Word 2007. So, now the new computer is running Office Home and Business 2013, Word 2007, and Access Run-time 2013.
    Regardless, your security doc, .docm, on the server is looking for an Office 12 folder. It was not until after you installed Word 2007 that this folder and probably an appropriate .dll file was available on the new machine.

    In essence, you are still stuck in the last decade, chronologically speaking.

    The program worked fine with Office 2007 and today the program still works well with Office 2007. You will need to upgrade the secured Word doc to a newer version to play well with Office 2010 or 2013.

    Another option might be available. You might start your look here.... not sure if the downloads offer a better fix than simply installing Word 2007
    http://www.accessribbon.de/en/?Trust...sted_Locations

Page 1 of 2 12 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 12
    Last Post: 10-03-2013, 12:32 PM
  2. Problem with 2013
    By rpeare in forum Access
    Replies: 1
    Last Post: 09-10-2013, 09:22 AM
  3. Access 2013 running very slow
    By razors1968 in forum Access
    Replies: 0
    Last Post: 08-01-2013, 01:31 PM
  4. Replies: 2
    Last Post: 10-02-2012, 09:54 PM
  5. Problem moving database to another computer
    By DB2010MN26 in forum Access
    Replies: 4
    Last Post: 11-22-2011, 04: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
  •  
Other Forums: Microsoft Office Forums