Results 1 to 9 of 9

Thread: Run-time error 430

  1. #1

    Thread Starter
    Member
    Join Date
    Apr 2005
    Posts
    48

    Run-time error 430

    Hi,

    I know that this has been posted before, but nothing has helped me to resolve the problem.

    I have an application written in VB6 that connects to an Access database. No problems there. I am able to add/amend and delete data through the application. I can also run any of the reports that I have created.

    When I try to open a mail merge Word document I get the '430' error. (Class does not support etc)

    I have never come across this before so am pretty stuck.

    I have checked that the client machine has the correct version of MDAC and that we are using the same version of Office (2000).

    Both machines are running XP but mine, the development one, has SP2 installed where as the client has SP1. Would this cause an issue?

    As far as I can tell the application fails on this line of code:

    myWordApp.Documents.Open Trim(OpenFile.lpstrFile)

    Can anyone help?

    Many thanks

    Mark

  2. #2

  3. #3
    Banned randem's Avatar
    Join Date
    Oct 2002
    Location
    Maui, Hawaii
    Posts
    11,385

    Re: Run-time error 430

    Mr_Floyd1976,

    I imagine your client machine has Word installed?

  4. #4

    Thread Starter
    Member
    Join Date
    Apr 2005
    Posts
    48

    Re: Run-time error 430

    Quote Originally Posted by RhinoBull
    Welcome to Forums!

    You might need to post your code so we can take a look at it but do not post your entire program ...
    Hi, and thank you for the welcome

    Here is the code that I have behind the 'Print Letter' button.

    Private Sub cmdPrint_Click()

    'Add current details to tbl_Letter. All in GV
    Call fnDeleteLetters
    Call fnAddLetterDetails
    'now need to choose which letter
    'open a new form, small with radio buttons and OK
    Dim OpenFile As OPENFILENAME
    Dim lReturn As Long
    Dim sFilter As String
    OpenFile.lStructSize = Len(OpenFile)
    OpenFile.hwndOwner = frmDetails.hWnd
    OpenFile.hInstance = App.hInstance
    sFilter = "Word Documents (*.doc)" & Chr(0) & "*.DOC" & Chr(0)
    OpenFile.lpstrFilter = sFilter
    OpenFile.nFilterIndex = 1
    OpenFile.lpstrFile = String(257, 0)
    OpenFile.nMaxFile = Len(OpenFile.lpstrFile) - 1
    OpenFile.lpstrFileTitle = OpenFile.lpstrFile
    OpenFile.nMaxFileTitle = OpenFile.nMaxFile
    OpenFile.lpstrInitialDir = "C:\Inhance\Documents"
    OpenFile.lpstrTitle = "Search For Inhance Letters"
    OpenFile.flags = 0
    lReturn = GetOpenFileName(OpenFile)
    If lReturn = 0 Then
    'do nothing, window closes
    Else
    'open word document fixed price letter
    Dim myWordApp As Word.Application
    Set myWordApp = New Word.Application
    myWordApp.Documents.Open Trim(OpenFile.lpstrFile)
    myWordApp.Application.Visible = True
    End If

    End Sub


    I havent had any problems with the same code used in a different application.

    Many thanks

    Mark

  5. #5
    Lively Member
    Join Date
    Apr 2005
    Posts
    127

    Re: Run-time error 430

    VB Code:
    1. Private Sub cmdPrint_Click()
    2.  
    3. 'Add current details to tbl_Letter. All in GV
    4. Call fnDeleteLetters
    5. Call fnAddLetterDetails
    6. 'now need to choose which letter
    7. 'open a new form, small with radio buttons and OK
    8. Dim OpenFile As OPENFILENAME
    9. Dim lReturn As Long
    10. Dim sFilter As String
    11. OpenFile.lStructSize = Len(OpenFile)
    12. OpenFile.hwndOwner = frmDetails.hWnd
    13. OpenFile.hInstance = App.hInstance
    14. sFilter = "Word Documents (*.doc)" & Chr(0) & "*.DOC" & Chr(0)
    15. OpenFile.lpstrFilter = sFilter
    16. OpenFile.nFilterIndex = 1
    17. OpenFile.lpstrFile = String(257, 0)
    18. OpenFile.nMaxFile = Len(OpenFile.lpstrFile) - 1
    19. OpenFile.lpstrFileTitle = OpenFile.lpstrFile
    20. OpenFile.nMaxFileTitle = OpenFile.nMaxFile
    21. OpenFile.lpstrInitialDir = "C:\Inhance\Documents"
    22. OpenFile.lpstrTitle = "Search For Inhance Letters"
    23. OpenFile.flags = 0
    24. lReturn = GetOpenFileName(OpenFile)
    25. If lReturn = 0 Then
    26. 'do nothing, window closes
    27. Else
    28. 'open word document fixed price letter
    29. Dim myWordApp As Word.Application
    30. Set myWordApp = New Word.Application
    31. myWordApp.Documents.Open Trim(OpenFile.lpstrFile)
    32. myWordApp.Application.Visible = True
    33. End If
    34.  
    35. End Sub


    Welcome..
    When you post a code you can use this...
    [ vbcode ]
    Code here
    [ /vbcode ]

    Its all connected to each other... I just couldn't write it like that :P

  6. #6

    Thread Starter
    Member
    Join Date
    Apr 2005
    Posts
    48

    Re: Run-time error 430

    Quote Originally Posted by Brin

    Welcome..
    When you post a code you can use this...
    [ vbcode ]
    Code here
    [ /vbcode ]

    Its all connected to each other... I just couldn't write it like that :P
    Thanks for the info.

    I just pasted it in, so it wasnt too much hassle...

  7. #7

    Thread Starter
    Member
    Join Date
    Apr 2005
    Posts
    48

    Re: Run-time error 430

    Boing!

  8. #8
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: Run-time error 430

    Do you have declarations like this?
    VB Code:
    1. Dim appWord As Object
    2.     Dim strDoc As String
    3.     Set appWord = CreateObject("Word.Application")
    4.     appWord.Documents.Open strDoc
    5.     appWord.Visible = True
    6.     strDoc = app.path & "MyDoc.doc"

  9. #9

    Thread Starter
    Member
    Join Date
    Apr 2005
    Posts
    48

    Re: Run-time error 430

    Quote Originally Posted by dglienna
    Do you have declarations like this?
    VB Code:
    1. Dim appWord As Object
    2.     Dim strDoc As String
    3.     Set appWord = CreateObject("Word.Application")
    4.     appWord.Documents.Open strDoc
    5.     appWord.Visible = True
    6.     strDoc = app.path & "MyDoc.doc"

    Hi,

    No, the only declarations I have relating to this are shown in the code I posted earlier.

    This has worked on other XP machines in the past.

    Mark

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