dannyboy1982
Board Regular
- Joined
- Mar 6, 2015
- Messages
- 60
Hi,
I have the following code that I have been using for a few days with no problem, and today I started getting 'Run time 1004' error messages.
I am creating a new workbook, combining the contents of cell B1 and Y2 to create a file name and saving it as a .xlsm file.
Code:
Any help with this would be greatly appreciated.
Regards
DR
I have the following code that I have been using for a few days with no problem, and today I started getting 'Run time 1004' error messages.
I am creating a new workbook, combining the contents of cell B1 and Y2 to create a file name and saving it as a .xlsm file.
Code:
Code:
Sub NewWB()
Dim name1 As String
Dim name2 As String
name1 = ActiveWorkbook.Sheets(1).Range("B1").Value
name2 = ActiveWorkbook.Sheets(1).Range("Y2").Value
Application.ScreenUpdating = False
Workbooks.Add
'Saving the Workbook
ActiveWorkbook.SaveAs "C:\DR\Cp and Cpk\" & name1 & " " & name2 & ".xlsm", FileFormat:=xlOpenXMLWorkbookMacroEnabled, CreateBackup:=False
Workbooks("SPC V1.xlsm").Sheets("Job dimensions").Activate
Call data
ActiveWorkbook.Save
ActiveWindow.Close
End Sub
Any help with this would be greatly appreciated.
Regards
DR