Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / September 2005

Tip: Looking for answers? Try searching our database.

Problem with templates after migration from word 97 to word 2002

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
jj - 06 Sep 2005 19:32 GMT
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
Helmut Weber - 06 Sep 2005 19:42 GMT
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.

Signature

Greetings from Bavaria, Germany

Helmut Weber, MVP WordVBA

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

jj - 06 Sep 2005 21:07 GMT
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
> 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.
Helmut Weber - 07 Sep 2005 14:57 GMT
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.

Signature

Greetings from Bavaria, Germany

Helmut Weber, MVP WordVBA

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

Edward Thrashcort - 07 Sep 2005 17:45 GMT
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
>
[quoted text clipped - 13 lines]
> >
> > And what is in the definition section of the code.
Edward Thrashcort - 06 Sep 2005 20:48 GMT
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

> Hi Ng
>
[quoted text clipped - 10 lines]
> Thanks in advance
>  JJ
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.