Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 01-04-2022, 01:56 PM
grandneos grandneos is offline VBA Excel method Not working Mac OS X VBA Excel method Not working Office 2016 for Mac
Novice
VBA Excel method Not working
 
Join Date: Jan 2022
Posts: 1
grandneos is on a distinguished road
Default 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
Attached Files
File Type: pdf Screen Shot 2022-01-04 at 12.36.38 PM.png.pdf (181.6 KB, 5 views)
Reply With Quote
  #2  
Old 01-04-2022, 08:11 PM
Logit Logit is offline VBA Excel method Not working Windows 10 VBA Excel method Not working Office 2007
Expert
 
Join Date: Jan 2017
Posts: 529
Logit is a jewel in the roughLogit is a jewel in the roughLogit is a jewel in the rough
Default

This line :

ID = Range("]6"). Value & "xlsm"

Should have a "dot" before xlsm :

ID = Range("]6"). Value & ".xlsm"


There may be other errors.
Reply With Quote
  #3  
Old 01-07-2022, 11:19 AM
p45cal's Avatar
p45cal p45cal is offline VBA Excel method Not working Windows 10 VBA Excel method Not working Office 2019
Expert
 
Join Date: Apr 2014
Posts: 863
p45cal has a brilliant futurep45cal has a brilliant futurep45cal has a brilliant futurep45cal has a brilliant futurep45cal has a brilliant futurep45cal has a brilliant futurep45cal has a brilliant futurep45cal has a brilliant futurep45cal has a brilliant futurep45cal has a brilliant futurep45cal has a brilliant future
Default

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.
Reply With Quote
Reply

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

Other Forums: Access Forums

All times are GMT -7. The time now is 07:49 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft