Re: VBA doesn't recognised mid(..) and left(..)
From: Neil Penn (neil.penn_at_btinternet.com)
Date: 03/14/04
- Next message: Jerry Bodoff: "Re: General Question about VBA F1 Help Key"
- Previous message: DABOM8: "Prints blank pages HELP!"
- In reply to: Peter Hewett: "Re: VBA doesn't recognised mid(..) and left(..)"
- Next in thread: Peter Hewett: "Re: VBA doesn't recognised mid(..) and left(..)"
- Reply: Peter Hewett: "Re: VBA doesn't recognised mid(..) and left(..)"
- Messages sorted by: [ date ] [ thread ]
Date: Sun, 14 Mar 2004 09:43:54 -0000
Thanks for the link below. The explanation given there is to do with a
missing reference, which doesn't seem to directly explain why renaming a
document to a template will cause the problem - in the new document created
fro the template the VBA references do all appear to be set the same as they
were in the original .DOC document.
I found that if I added in full references to the functions - for example
VBA.String.Mid(..) or VBA.String.Left(..) then it worked ok.
I would conclude that using rename to create a template must create a
problem with the references for the VBA project.
Thanks for your help.
"Peter Hewett" <nospam@xtra.co.nz> wrote in message
news:dr1250dti4t8gmf8bkiv8ba8n2grtnbk5i@4ax.com...
> Hi Neil Penn
>
> Check out the following link:
>
> Undefined Variable: Mid, Left, Right not working
> http://word.mvps.org/faqs/apperrors/MidNotWorking.htm
>
> HTH + Cheers - Peter
>
>
> "Neil Penn" <neil.penn@btinternet.com>, said:
>
> >Word 2000
> >Windows 2000
> >
> >This is really weird.
> >
> >This evening I wrote a VBA macro to go to a database to bring back data
and
> >replace some values in a Word document.
> >
> >I developed the macro in a .DOC until it all ran ok, then renamed the
> >document to a .DOT for final use.
> >
> >When I went to test the .DOT things went very strange. First none of the
> >enumerations or constants were being recognised - for example adStateOpen
> >for ADO wasn't recognised and the Microsoft Scripting constant for
opening a
> >text file for reading wasn't recognised either. OK - I just wrote local
> >variables to re-define the constants to get around that problem. What
really
> >through me was when VBA said it didn't recognised mid(..) and left(..)
> >functions. At this point I went home.
> >
> >I am hoping that when I get in tomorrow a reboot will sort everything
out,
> >but if not can anyone think what has caused the problem?
> >
> >I should add that the references are still all in the project. If I hit
F2 I
> >can find all the references it says it doesn't recognise.
> >
> >I really need it to run as a .DOT as the code runs about replacing
> >placeholders with database data so I don't want to change the original
> >document.
> >
>
- Next message: Jerry Bodoff: "Re: General Question about VBA F1 Help Key"
- Previous message: DABOM8: "Prints blank pages HELP!"
- In reply to: Peter Hewett: "Re: VBA doesn't recognised mid(..) and left(..)"
- Next in thread: Peter Hewett: "Re: VBA doesn't recognised mid(..) and left(..)"
- Reply: Peter Hewett: "Re: VBA doesn't recognised mid(..) and left(..)"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|