excel vba activeworkbook.saveas error Corcoran California

Address 220 E Inyo Ave, Tulare, CA 93274
Phone (559) 684-8523
Website Link http://pcmobiletechs.biz

excel vba activeworkbook.saveas error Corcoran, California

Members List Calendar Forum Rules Dashboard Commercial Services Advanced Search Forum Microsoft Office Application Help - Excel Help forum Excel Programming / VBA / Macros File SaveAs causing run-time error To Public Sub CommandButton1_Click() Dim YesOrNoAnswerToMessageBox As String Dim QuestionToMessageBox As String Dim CurrentFile As String QuestionToMessageBox = "Do you want to save?" YesOrNoAnswerToMessageBox = MsgBox(QuestionToMessageBox, vbYesNo, "Save file") If YesOrNoAnswerToMessageBox = Join them; it only takes a minute: Sign up Run time error 1004 for saving excel file (VBA required) up vote 3 down vote favorite 2 I was wondering if anyone UPDATE heap table -> Deadlocks on RID Logical fallacy: X is bad, Y is worse, thus X is not bad EvenSt-ring C ode - g ol!f How to make files protected?

About Us PC Review is a computing review website with helpful tech support forums staffed by PC experts. Browse other questions tagged excel vba excel-vba or ask your own question. If I choose NO, I want the macro to finish nicely. share|improve this answer edited Apr 14 at 5:36 answered Apr 14 at 4:47 Mike Benstead 413 Thanks Mike, much appreciated even now! –Riccardo Apr 18 at 9:11 add a

If you don'rt want the prompt and want the file to save anyway, use Code: Application.DisplayAlerts = False 'your code Application.DisplayAlerts = True Share Share this post on Digg Del.icio.us Technorati I prefer to use the full UNC path (\Thismachine...), in case the workbook gets used on a machine that doesn't have the mapped drive set up. Ozgrid is Not Associated With Microsoft. Is intelligence the "natural" product of evolution?

What advantages does Monero offer that are not provided by other cryptocurrencies? Hope this helps Michael Reply With Quote 10-22-2011,03:59 PM #3 mancubus View Profile View Forum Posts View Blog Entries View Articles VBAX Master Joined Dec 2010 Location where i lay my Not the answer you're looking for? Make all the statements true Are there any rules or guidelines about designing a flag?

No, create an account now. The time now is 17:16. Anyway, to prompt the user for a save location try modifying the following as you require: Sub DoooooooooooooooooooIt() Dim fd As FileDialog Set fd = Application.FileDialog(msoFileDialogSaveAs) With fd .Show If .SelectedItems.Count We're a friendly computing community, bustling with knowledgeable members to help solve your tech questions.

Runtime Error 1004: "Method 'SaveAs' o object '_workbook' faile The method is: (where sWorkBookPath and sFileName are variables for m path and filename ActiveWorkbook.SaveAs Filename:=sWorkBookPath & "\" & sFileName & ".txt", Results 1 to 3 of 3 Thread: [Solved] VBA: VBA SaveAs Error handling Thread Tools Show Printable Version Search Thread Advanced Search July 26th, 2003 #1 willnjen View Profile View How to get this substring on bash script? (Somewhat) generalised mean value theorem Are independent variables really independent? What kind of bicycle clamps are these?

Can two integer polynomials touch in an irrational point? C:\Users\Mike\AppData\Roaming\Microsoft\Excel\DIARY(version 1).xlxb If so the solution is (as stated above by others) to save your file to its correct path and file name. When must I use #!/bin/bash and when #!/bin/sh? With the passing of Thai King Bhumibol, are there any customs/etiquette as a traveler I should be aware of?

How to get this substring on bash script? It's completely unnecessary and should not be combined with ActiveWorkbook. I tested it with the same name and file extension that I am using in my vba and it works. Players stopping other player actions Why is it a bad idea for management to have constant access to every employee's inbox What are "desires of the flesh"?

This riddle could be extremely useful In the United States is racial, ethnic, or national preference an acceptable hiring practice for departments or companies in some situations? more hot questions question feed lang-vb about us tour help blog chat data legal privacy policy work here advertising info mobile contact us feedback Technology Life / Arts Culture / Recreation All rights reserved. Thank you so much for your help!

What am I missing? Here is my code: Code: sDirectory ="C:\..\MyDocuments" sTargetFile = "NewFile.xls" ActiveWorkbook.SaveAs Filename:=sDirectory & "\" & sTargetFile, _ FileFormat:=xlExcel8, _ CreateBackup:=False, _ ReadOnlyRecommended:=False, _ Password:="", _ WriteResPassword:="" Application.ActiveWorkbook.Close Thank you, John, In share|improve this answer answered Mar 10 '15 at 17:05 Degustaf 2,2762725 add a comment| up vote 3 down vote This is a year old, but I'll add something for future readers When I select 'no' or 'cancel' th following error occurs...

cruisy Guest Hi there, I hope there is a really simple answer to this but I have not been abl to find a simple solution to error trapping the ActiveWorkbook.SaveA method. I had to map the network drive to give it a name designation (i.e. So, we can approach this as how can we copy this sheet to a new workbook, and get a reference to that workbook. share|improve this answer answered Aug 21 '15 at 12:40 Eric Harlan 647 add a comment| Your Answer draft saved draft discarded Sign up or log in Sign up using Google

I was wondering if it is possible to give user the option to save it at his/her favourite spot, and also his/her favorite name? Yes I am saving to a network drive and security problems was my initial thought. File Format Name - FileFormat Value Excel 2007-2010 Binary Workbook (.xlsb) - 50 Excel 2007-2010 Workbook (.xlsx) - 51 Excel 2007-2010 Macro-Enabled Workbook (.xlsm) - 52 Excel 2007-2010 Macro-Enabled Template (.xltm) And I can't think of a workaround to use with error trapping.

Using Java's Stream.reduce() to calculate sum of powers gives unexpected result more hot questions question feed lang-vb about us tour help blog chat data legal privacy policy work here advertising info EDIT: Solved thanks to Degustaf suggestion. If Dumbledore is the most powerful wizard (allegedly), why would he work at a glorified boarding school? I made only two changes to Degustaf's suggested code: ThisWorkbook.Sheets instead of CurrentWorkbook.Sheets FileFormat:=6 instead of FileFormat:=xlCSV (apparently is more robust to differente versions of excel) Sub SaveWorksheetsAsCsv() Dim SaveToDirectory As

How do I explain that this is a terrible idea? Register To Reply 06-03-2009,10:14 AM #2 shg View Profile View Forum Posts Forum Guru Join Date 06-20-2007 Location The Great State of Texas MS-Off Ver 2003, 2010 Posts 36,739 Re: File Is there a place in academia for someone who compulsively solves every problem on their own? All contents Copyright 1998-2016 by MrExcel Consulting.

But if I choose NO, the Macro fails. Sign Up Now! Microsoft MVP - Excel Entia non sunt multiplicanda sine necessitate Register To Reply 06-03-2009,10:58 AM #3 c4tin View Profile View Forum Posts Registered User Join Date 03-10-2009 Location Wisconsin, USA MS-Off I have the following code as a module in my workbook Option Explicit Sub Save_Password() Application.DisplayAlerts = False Dim Open_Password As String Dim New_File_Name As String New_File_Name = Sheets("QryData").Range("J32").Value & "\"

excel vba excel-vba share|improve this question asked Apr 3 '15 at 18:32 Rusty S. 111 Does it work if you change the mapped drive (H) to a UNC, e.g., fName$ = Application.GetSaveAsFilename ActiveWorkbook.SaveAs Filename:=fName$ _ This works fine except when I try to give the saved file a name that already exists. That is Cool! Register Help Remember Me? Portal Forum FAQ Calendar Forum Actions Mark Forums Read Quick Links View Site Leaders Knowledgebase Articles Blogs Resources Consulting Services Training PayPal Donation Advanced Search Forum

If you're having a computer problem, ask on our forum for advice. asked 4 years ago viewed 12745 times active 4 years ago Get the weekly newsletter! You can avoid these by attaching your hyperlinks to a text box or generating them with the HYPERLINK function. Sign up now!

CurrentWorkbook.Sheets("My_Sheet").SaveAs Filename:=SaveToDirectory & "My_Sheet" & ".csv", FileFormat:=xlCSV I will warn you to resave the workbook to its original name afterwarsd, if it is staying open, but you already have that in Powered by vBulletin Version 4.2.2 Copyright © 2016 vBulletin Solutions, Inc.