|
是公共盘权限问题还是?我在自己本地文件没问题,
Private Sub CommandButton1_Click()
Dim Z As Variant
Dim X As Variant
Application.DisplayAlerts = False '取消EXCEL弹出窗口
p = ThisWorkbook.Path & "\" '取得当前工作簿路径赋值于p
X = Sheets(1).Cells(2, 42)
f = Dir(p & "日报 " & Format(X, "yyyy" & "mm" & "dd") & "*.xls") 'f 判断是否已存在drr当日
If f = "" Then
ThisWorkbook.SaveCopyAs Filename:=p & "日报" & Format(X, "yyyy" & "mm" & "dd") & ".Xls"
Application.DisplayAlerts = True
MsgBox ("已保存至公共盘")
Else
Z = MsgBox("存在同一个是否覆盖", 4, "是否覆盖")
Select Case Z
Case Is = 6
ThisWorkbook.SaveCopyAs Filename:=p & "日报 " & Format(X, "yyyy" & "mm" & "dd") & ".Xls"
Application.DisplayAlerts = True
MsgBox ("已保存至公共盘")
Case Is = 7
MsgBox ("未保存")
End Select
Application.DisplayAlerts = True
End If
End Sub
|
|