I have various macros that were originally written in Wordbasic. I have
rewritten or converted most to VBA code but one particular piece of code
won't seem to work in VBA so I must be doing something wrong. an instance is
WordBasic.Call "somemacorname.ITUPrintPSToDisk", filename
will work but If I drop the Wordbasic it will not. (filename is a variable
containing a name of the file to be printed by the macro)
This may be very basic but I can't seem to get it to work.
ps I have got other Call commands to work but not when they refer to a
subroutine in a macro as the one above does.
Thanks
Phil
Martin Seelhofer - 02 Feb 2005 15:40 GMT
Hey Phil
> WordBasic.Call "somemacorname.ITUPrintPSToDisk", filename
>
> will work but If I drop the Wordbasic it will not. (filename is a variable
> containing a name of the file to be printed by the macro)
Here are 2 possible solutions:
1. remove the "-s around your macroname and transform your code
into a normal VBA call:
Call somemacroname.ITUPrintPSToDisk(filename)
2. Use Application.Run instead:
Application.Run "somemacroname.ITUPrintPSToDisk", filename
Cheers,
Martin
Howard Kaikow - 02 Feb 2005 15:45 GMT
somemacorname.ITUPrintPSToDisk filename

Signature
http://www.standards.com/; See Howard Kaikow's web site.
> I have various macros that were originally written in Wordbasic. I have
> rewritten or converted most to VBA code but one particular piece of code
[quoted text clipped - 13 lines]
>
> Phil
Phil Stokes - 03 Feb 2005 12:41 GMT
Tried this
somemacorname.ITUPrintPSToDisk filename
but it didn't work.
I found that Application.Run worked ok and I'll use that code
Thanks to all that responded.
Phil
> > I have various macros that were originally written in Wordbasic. I have
> > rewritten or converted most to VBA code but one particular piece of code
[quoted text clipped - 14 lines]
> >
> > Phil
Howard Kaikow - 06 Feb 2005 19:40 GMT
Application.run is another alternative.
Depends on how things are set up.

Signature
http://www.standards.com/; See Howard Kaikow's web site.
> Tried this
> somemacorname.ITUPrintPSToDisk filename
[quoted text clipped - 25 lines]
> > >
> > > Phil