open file in vbscript

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
ian

open file in vbscript

Post by ian » Mon Sep 01, 2003 3:31 pm

>I am attempting to run the following in VBScript
>
>If Left(TransRef,5)="00000"
>And Len(TransRef)=10 Then
>MsgBox ("Not an Invoice")
>Else
>ActiveWorkbook.FollowHyperlink
>Address:="C:\pdfscan\0000030525.pdf",_NewWindow:=True
>End If
>
>The "Active Workbook.FollowHperlink" etc function does not
>appear to be recognised in VBScript-is there a replacment?
>
>Thanks in advance for any help.
>
>ian
>
>.
>

User avatar
support
Automation Wizard
Posts: 1450
Joined: Sat Oct 19, 2002 4:38 pm
Location: London
Contact:

Post by support » Mon Sep 01, 2003 8:16 pm

Hi,

You need to specify the object to which ActiveWorkbook is a property. My guess is this is an Excel property. Therefore you will need to create the Excel object and prefix your ActiveWorkbook call with the object variable.
MJT Net Support
[email protected]

Post Reply
cron
Sign up to our newsletter for free automation tips, tricks & discounts