Calling VBScript file in vba

smichael

New Member
Joined
Jul 15, 2011
Messages
38
I have a code that successfully calls up a VBS file over the C drive, but i can't get it to work for a file that isn't saved locally. Is there a way to alter my code for this to open a file saved on a separate computer over a server?

here's my code:
Code:
Sub SendEmail()
'
' SendEmail Macro
'
'Opens VBS file to send e-mail of copy
    Dim filespe As String
        filespe = "cmd.exe /c [URL="file://\\ABE2-MP\Data\PartUseEmail.vbs"]\\ABE2-MP\Data\PartUseEmail.vbs[/URL]"
        x = Shell(filespe, 1)
        
    Application.WindowState = xlNormal
    Application.DisplayAlerts = True
'
End Sub

Thanks for the help!
 

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.

Forum statistics

Threads
1,224,597
Messages
6,179,808
Members
452,944
Latest member
2558216095

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top