|
Sub ボタン1_Click()
Dim mySheet As Worksheet
Set mySheet = ActiveWorkbook.Worksheets("送品明細")
mySheet.Copy
MsgBox "新規ブックにシートをコピーしました"
Dim WshShell As Object
Dim MyF As String
Set WshShell = CreateObject("WScript.Shell")
WshShell.CurrentDirectory = "\\123.456.78.9\製造課\"
Const myDir As String = "\\123.456.78.9\製造課\送品明細書\"
If Dir(myDir, vbDirectory) = vbNullString Then _
MkDir myDir
With Application
.DisplayAlerts = False
With Application
.DisplayAlerts = True
End With
End With
Set WshShell = CreateObject("WScript.Shell")
WshShell.CurrentDirectory = "\\123.456.78.9\製造課\送品明細書\"
Const myPath As String = "\\123.456.78.9\製造課\送品明細書\"
Dim myFileName As String
myFileName = Application.GetSaveAsFilename _
(ActiveWorkbook.Name, "Excelファイル(*.xls),*.xls")
If myFileName = "False" Then
Exit Sub
Else
With Application
.DisplayAlerts = False
ActiveWorkbook.SaveAs myFileName
.DisplayAlerts = True
End With
End If
End Sub
↑上記の内容で、指定したIP先にファイルが作成されません。
間違いに思い当たるふしがないのですが....。
宜しくお願い致します。
|
|