|
-
Apr 25th, 2005, 10:20 AM
#1
Thread Starter
Member
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
-
Apr 25th, 2005, 12:58 PM
#2
Re: Run-time error 430
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 ...
-
Apr 25th, 2005, 01:02 PM
#3
Re: Run-time error 430
Mr_Floyd1976,
I imagine your client machine has Word installed?
-
Apr 25th, 2005, 02:42 PM
#4
Thread Starter
Member
Re: Run-time error 430
 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
-
Apr 25th, 2005, 03:43 PM
#5
Lively Member
Re: Run-time error 430
VB Code:
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
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
-
Apr 25th, 2005, 04:14 PM
#6
Thread Starter
Member
Re: Run-time error 430
 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...
-
Apr 26th, 2005, 02:32 AM
#7
Thread Starter
Member
-
Apr 26th, 2005, 02:52 AM
#8
Re: Run-time error 430
Do you have declarations like this?
VB Code:
Dim appWord As Object
Dim strDoc As String
Set appWord = CreateObject("Word.Application")
appWord.Documents.Open strDoc
appWord.Visible = True
strDoc = app.path & "MyDoc.doc"
-
Apr 26th, 2005, 05:23 AM
#9
Thread Starter
Member
Re: Run-time error 430
 Originally Posted by dglienna
Do you have declarations like this?
VB Code:
Dim appWord As Object
Dim strDoc As String
Set appWord = CreateObject("Word.Application")
appWord.Documents.Open strDoc
appWord.Visible = True
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|