wb.SaveAs Filename:=outputfile, FileFormat:=51
ShellExecute 0, "open", "C:\Documents and Settings", 0, 0, 1
ShellExecute 0, "open", "\\MyServer\MyLibrary\Staff Directory", 0, 0, 1
ASKER
Set oWshNetwork = CreateObject("WScript.Network")
Set fso = CreateObject("Scripting.FileSystemObject")
'map a drive to the sharepoint server
On Error Resume Next
oWshNetwork.MapNetworkDrive "M:", strPath, "False", strUser, strPwd
If Err.Number <> 0 Then
MsgBox "Error accessing \\mySharePointSite\myLibrary\Staff Directory. Please verify that you are on the network."
SaveNewDir = 1
Exit Function
End If
'copy file to the newly mapped M:\ drive.
If fso.FileExists(outputFile) Then
fso.CopyFile outputFile, "M:\"
Else
MsgBox outputFile & " file not found."
End If
oWshNetwork.RemoveNetworkDrive "M:"
Visual Basic is Microsoft’s event-driven programming language and integrated development environment (IDE) for its Component Object Model (COM) programming model. It is relatively easy to learn and use because of its graphical development features and BASIC heritage. It has been replaced with VB.NET, and is very similar to VBA (Visual Basic for Applications), the programming language for the Microsoft Office product line.
TRUSTED BY
ASKER
Thanks!!!
brl8