ActiveWorkbook.SaveAs

时间:2019-04-09 07:35:30

标签: excel vba

这可能是一个简单的任务,但是由于某些原因,我不太正确。

我想将活动工作簿的副本保存到其他文件。过去我曾使用代码对日期进行此操作,但是我想删除日期。我过去使用的代码如下:

ActiveWorkbook.SaveCopyAs "P:\Wealth Management Products & Services\Investment Research & Communication\Structured Products\" &Format(dtdate) & " " & "Structured Product Tool" & " " & "Bloomberg" &".xlsm"

我要删除日期,因此名称为:结构化产品工具Bloomberg

我认为应该是这样:

ActiveWorkbook.SaveCopyAs "P:\Wealth Management Products Services\Investment Research & Communication\Structured Products\"Structured Product Tool" & " " & "Bloomberg" & ".xlsm"

但是我遇到了错误。

有人知道正确的代码吗?

谢谢彼得

1 个答案:

答案 0 :(得分:0)

您在声明中缺少与号&

ActiveWorkbook.SaveCopyAs "P:\Wealth Management Products & Services\Investment" _
    & "Research & Communication\Structured Products\" _
    & "Structured Product Tool" & " " & "Bloomberg" & ".xlsm"