#1
|
|||
|
|||
VBA Excel method Not working
I am looking to create a macro that allows me to save a new file with the file name as the one in cell J6. I keep getting a run time error as '1004': how do I fix this problem?Below is the code
Sub Macro20 Macro2 Macro Dim ID As String Dim Path As String Path = "/Users/viniweichselbaumer/Documents/Server/Finance and Admin/Business App Development /" ID = Range("]6"). Value & "xlsm" Application.DisplayAlerts = False ActiveWorkbook.SaveAs FileName: =Path & ID, FileFormat: =x|sm Application.DisplayAlerts = True ActiveWorkbook.Close End Sub |
#2
|
|||
|
|||
This line :
ID = Range("]6"). Value & "xlsm" Should have a "dot" before xlsm : ID = Range("]6"). Value & ".xlsm" There may be other errors. |
#3
|
||||
|
||||
Shouldn't those forward slashes be back-slashes?
I don't think Excel will recognise xlsm as a fileformat. Try either xlOpenXMLWorkbookMacroEnabled or 52 or miss it out altogether. |
Thread Tools | |
Display Modes | |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Excel stopped working. | nodsirrah | Excel | 9 | 07-01-2017 04:58 AM |
vba error method or data member not found in excel 2010 | Rose roon | Excel Programming | 0 | 09-08-2015 03:51 AM |
Is using and Excel Table to be accessed by other Office Programs the best Method?? | feychylde | Excel | 0 | 05-24-2015 12:30 PM |
Windows GetOpenFileName Method Workaround for Excel 2011 on MAC | Story11 | Excel Programming | 37 | 01-26-2015 09:34 PM |
Excel error window: Excel has stopped working | MunganBrus | Excel | 1 | 01-13-2015 11:19 AM |