Problem with templates after migration from word 97 to word 2002

J

jj

Hi Ng

I have got some word templates from office 97 - the templates contains som
userforms, and some VBA code.

Now we have Migrated from office 97 to office XP (2002), and now none of the
templates are working. Typically it fails with error-message type mismatch.

Is there anything I have missed - like some references or can anyone explain
what the problem is.?

Thanks in advance
JJ
 
H

Helmut Weber

Hi,

step through the code in single step mode [F8],
and show us where an error occurs and what error.

And what is in the definition section of the code.

--
Greetings from Bavaria, Germany

Helmut Weber, MVP WordVBA

Win XP, Office 2003
"red.sys" & Chr$(64) & "t-online.de"
 
E

Edward Thrashcort

Wellcome to the world of backward INcompatibility that is so typical of new
MS Word versions!!

Try Debugging the code when it hits an error
can anyone explain what the problem is.?

Can you explain exactly what the error is?

Eddie
 
J

jj

Hi

Dim arrayAsatser() As String
Dim ovk As String
Dim ydd As String

ydd = Mid$(arrayAsatser(ovk, 4, 1), 1, 2)

and the error msg is "type mismatch"

thx
 
H

Helmut Weber

Hi jj,

I wonder, whether the very code you've posted, worked in Word 97,
as far as I know there is now way, to address an Element in an array
be it 3-dimensional or not,
by (String [, number [, number]]):

Dim ovk As String
arrayAsatser(ovk, 4, 1) ?

Gets me a type mismatch in Word 97, too.

--
Greetings from Bavaria, Germany

Helmut Weber, MVP WordVBA

Win XP, Office 2003
"red.sys" & Chr$(64) & "t-online.de"
 
E

Edward Thrashcort

I can replicate your problem ONLY if the value of ovk does not evaluate to
an integer. I assume that the arrayAsatser() is "Redimmed" somwhere?

Sub testit()

Dim arrayAsatser(9, 9, 9) As String
Dim ovk As String
Dim ydd As String

'This works OK (surprisingly)
ovk = "3"
arrayAsatser(ovk, 4, 1) = 98765
MsgBox Mid$(arrayAsatser(ovk, 4, 1), 1, 2)

'This produces a 'Type Mismatch Error'
ovk = "Three"
arrayAsatser(ovk, 4, 1) = 12345
MsgBox Mid$(arrayAsatser(ovk, 4, 1), 1, 2)

End Sub


Eddie
Hi

Dim arrayAsatser() As String
Dim ovk As String
Dim ydd As String

ydd = Mid$(arrayAsatser(ovk, 4, 1), 1, 2)

and the error msg is "type mismatch"

thx
Helmut Weber said:
Hi,

step through the code in single step mode [F8],
and show us where an error occurs and what error.

And what is in the definition section of the code.

--
Greetings from Bavaria, Germany

Helmut Weber, MVP WordVBA

Win XP, Office 2003
"red.sys" & Chr$(64) & "t-online.de"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top