更新时间:2023-02-15 17:37:33
此代码更新可以解决问题:
This update to your code should do the trick:
Private Sub CommandButton1_Click()
Dim title As String
Dim wrkBk As Workbook
'As this code sits behind the command button on the form, ME is a reference to the form.
title = StrConv(Me.TextBox1.Value, vbProperCase)
'Set a reference to the workbook - code or user interaction may change the activeworkbook.
Set wrkBk = Workbooks.Open("C:\Modelos\MODELO - PACKING LIST.xlsx")
wrkBk.SaveAs "C:\Users\andre.lins\Documents\Processos\Packs\PKDB\Packing list - " & title & ".xlsx", FileFormat:=xlOpenXMLWorkbook, CreateBackup:=False
End Sub