保存先がサーバからSharePointになり起動できなくなりました。どのように変更するとよいのでしょうか。
現在使用しているもの
FilePath = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.xlsm" '任意の保存先へ変更
MacroName = "CheckAll"
Set fso = CreateObject("Scripting.FileSystemObject")
ret = fso.FileExists(FilePath)
If ret = True Then
Set gf = fso.GetFile(FilePath)
ret = (gf.Attributes And 1) <> 0
If ret = False Then
sFileName = fso.getFileName(FilePath)
On Error Resume Next
gf.Name = "tmp_" & sFileName
gf.Name = sFileName
If Err.Number <> 0 Then
ret = False
Else
ret = True
End If
On Error Goto 0
Set excel = WScript.CreateObject("Excel.Application")
excel.Visible = False
excel.Workbooks.Open(FilePath)
excel.Application.Run MacroName, CBool(ret)
Set excel = Nothing
End If
Set gf = Nothing
End If
Set fso = Nothing
あなたの回答
tips
プレビュー