I have attached the file to assist and include the code below also: VB: Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean) Dim strName As String On Error Goto InvalidName Are two standard normal random variables always independent? Many thanks. "Jacob Skaria" wrote: > Workbooks.Open "C:\Users\TEST\Desktop\Stocks.csv" > Application.DisplayAlerts = False > ActiveWorkbook.SaveAs Filename:="C:\Users\TEST\Desktop\new stocks.xlsx", _ > FileFormat:=xlOpenXMLWorkbook, CreateBackup:=False > ActiveWorkbook.Close > Application.DisplayAlerts = True > > > If this It worked fine until I added in the date_string (which as you might guess, is a string with the as-of date for the file). http://mwdsoftware.com/error-1004/vba-runtime-error-1004.php
Lately we been having trouble getting the file to save to the FTP successfully. The time now is 04:18 AM. Regards Raghav Share Share this post on Digg Del.icio.us Technorati Twitter Reply With Quote Jan 21st, 2014,12:22 AM #5 SidKad New Member Join Date Jan 2014 Posts 1 Re: Excel macro What dice mechanic gives a bell curve distribution that narrows and increases mean as skill increases? https://support.microsoft.com/en-us/kb/292482
Red Flag This Post Please let us know here why this post is inappropriate. Below is the code I am using. Maybe because it's a network drive?Bizarre that 2007 started trying to URL encode my file paths though.Anyhow, thanks, PHV for once again pointing out the blindingly obvious mistakes! -> PHV RE: I also get the error regardless of the type of paste I use.
The time now is 09:18 AM. - Contact Us - ExcelBanter forum home - FAQ - Links - Privacy Statement - Top Powered by vBulletin Version 3.6.4Copyright ©2000 - 2016, Jelsoft Join our community for more solutions or to ask questions. Share Share this post on Digg Del.icio.us Technorati Twitter Reply With Quote Jul 2nd, 2014,06:47 AM #6 GingerBollix New Member Join Date Jul 2014 Posts 1 Re: Excel macro issue - Saveas Method Of Workbook Class Failed Vba RE: Workbook.SaveAs Excel 2007 Unhelpful Error Gruuuu (Programmer) (OP) 7 Jan 11 09:21 Well, yes, that's obvious.
You will be a Save the Current Worksheet as a New Excel Workbook File - This Excel Macro will save the currently visible/active worksheet (the one that you see when you I also just added the FileFormat -4143 in hopes that would correct the issue but still have the same problem. First Name Please enter a first name Last Name Please enter a last name Email We will never share this with anyone. More hints But I can't seem to save the file back to SharePoint under a different name.
Excel - Tips and Solutions for Excel Privacy Statement Terms of Service Top All times are GMT -4. Method 'saveas' Of Object '_workbook' Failed Excel 2010 Cheers, Andy Ask Your Own Question Macro To Change Delimiter When Saving A Csv File - Excel Excel Forum This macro takes a unique approach to creating the output file. This is why I brought it up....but that's not in my hfile.If I look at the value of hfile, it's along the lines of "Z:/Path/Path/File.xls"So, if indeed it's trying to insert Every time the problem has been related to legacy Macros being used in Office 2010.
Register To Reply 09-12-2014,03:36 PM #5 Angsome View Profile View Forum Posts Registered User Join Date 07-04-2013 Location Toronto MS-Off Ver Excel 2010 Posts 16 Re: Runtime Error '1004' Method 'SaveAs' http://www.pcreview.co.uk/threads/saveas-dialog-box-gives-run-time-error-1004-in-excel-vba.3894901/ in Excel In Excel, you can add shapes, images, objects, photos, and all sorts of items to the spreadsheet. Method Saveas Of Object _workbook Failed 2010 As far as I know that's where it is failing. Activeworkbook.saveas Runtime Error 1004 Can an NPC healer be part of a party of PCs, and if so, how does that work?
All rights reserved.Unauthorized reproduction or linking forbidden without expressed written permission. this content By that I mean that somehow you don't have that workbook (or any other) selected, and Excel doesn't know what to do. How can I diagnose possible problems with my breadboards? The code basically is suppose to compare the system date (date on your computer) to a date on the excel file. Runtime Error 1004 Saveas Method Of Workbook Class Failed
I have some VBA that worked fine in Excel 2003 that produces the above error in Excel 2007. Here is a list of alternatives I have tried thus far. This why I used the server name \\pleefs01\ name instead of the drive letter. weblink Many thanks Martyn vba code: Code: Sub Submit() Dim Aname As String Application.DisplayAlerts = False Application.ScreenUpdating = False Application.Run Macro:="Save" Const Title1$ = "Send to Head Office" Sheets("menu").Select Aname = Range("Filename")
Degustaf solution looks like it did the trick! Method Saveas Of Object _presentation Failed Why can't I select 'No'! 2) What other option do I have to display that the file is already there and select 'No' and not get the run-time error.? On close, the macro saves the file to a specific directory using that file name.
For the latter save my code looks like: -------------------------------------------------------------------- Dim fPath As String, fName As String Dim WkBk As Workbook Set WkBk = ThisWorkbook fPath = "\\ltf02\LPE\Lesson_Plans\Specials\" fName = WkBk.Name On ActiveWorkbook.SaveAs Filename:= _ "S:\Extract File " & date_string & ".xlsm" _ , FileFormat:=xlOpenXMLWorkbookMacroEnabled, CreateBackup:=False Ask Your Own Question Runtime Error 1004 Method Save Of Object _workbook Failed - Excel Excel Forum The following shortcuts will backup your worksheet in seconds: Ctrl+O, [highlight the filename], Ctrl+C, Ctrl+V, [ X ]. Excel Vba Saveas Error 1004 Go to Solution 2 Participants Martin Liss LVL 45 MS Excel35 Steve LVL 24 MS Excel24 2 Comments LVL 45 Overall: Level 45 MS Excel 35 Message Active today Accepted
It occurs in several places. I also want to save it to a shared folder on a network, but in this case I want it to be write protected. Sub CreateFile() FName = ActiveWorkbook.Name If Right(FName, 4) = ".xls" Then FName = Mid(FName, 1, Len(FName) - 4) End If Columns(1).Insert Shift:=xlToRight For i = 1 To Range("B65000").End(xlUp).Row TempString = "" http://mwdsoftware.com/error-1004/vba-runtime-error-1004-pivot-table.php The errant command is flagged between '***** comments.
© Copyright 2017 mwdsoftware.com. All rights reserved.