Opentextfile Error 53
Contents |
Forums Excel Questions Error 53 at 'Open filename for Output' Page 1 of 2 12 Last Jump to page: Results 1 to 10 of 11 Error 53 at 'Open filename for Output'This is a discussion on Error 53 at 'Open filename
Runtime Error 52 Bad File Name Or Number
for Output' within the Excel Questions forums, part of the Question Forums category; I try to runtime error 52 bad filename or number fix make a macro for saving an Excel sheet to a .CSV file with "@" as delimiter. At ... LinkBack LinkBack URL About LinkBacks runtime error 52 fix Bookmark & Share Digg this Thread!Add Thread to del.icio.usBookmark in TechnoratiTweet this thread Thread Tools Show Printable Version Display Linear Mode Switch to Hybrid Mode Switch to Threaded Mode Jun 2nd, 2009,06:45 AM #1 Tony007 New Member
Runtime Error 52 Excel Macro
Join Date Jun 2009 Location Scharsterbrug, Netherlands Posts 14 Error 53 at 'Open filename for Output' I try to make a macro for saving an Excel sheet to a .CSV file with "@" as delimiter. At the line "Open fname For Output As #fnum", the Error 53, "no file found" occurs. The Excel-help is saying that if the file is not present, a new file will be made. This error occurs now and then, How to proceed? Full
Visual Basic 6.0 Setup Toolkit Runtime Error 52
macro: Code: Sub SaveAsCSV() Path = "O:\actueel\" Fname1 = Path & Range("E2").Value & ".csv" fname = Application.GetSaveAsFilename(Fname1, "CSV bestand (*.csv), *.csv", , "") If fname = False Then MsgBox "Macro Geannuleerd" Exit Sub End If sep = "@" fnum = FreeFile Close #fnum Open fname For Output As #fnum lastrow = Range("K65536").End(xlUp).Row For Row = 2 To lastrow A = Cells(Row, 4).Value B = Cells(Row, 1).Value Print #fnum, A & sep & B & sep Next Row Close #fnum End Sub Last edited by Von Pookie; Jun 2nd, 2009 at 01:30 PM. Reason: Added code tags Share Share this post on Digg Del.icio.us Technorati Twitter Reply With Quote Jun 2nd, 2009,07:01 PM #2 xenou MrExcel MVPModerator Join Date Mar 2007 Location Clev. OH, USA Posts 14,867 Re: Error 53 at 'Open filename for Output' I suppose I am addicted to the filesystemobject so this uses it instead: Code: Sub SaveAsCSV() Dim FSO As Object '//FileSystemObject Dim ts As Object '//TextStreamObject Dim myPath As String Dim Fname1 As String Dim s As String Dim lastRow As Long Dim myRow As Long '//Create filesystemobject Set FSO = CreateObject("Scripting.FileSystemObject") myPath = "O:\actueel\" Fname1 = myPath & Range("E2").Value & ".csv" '//abort if file already exists If FSO.FileExists(Fname1) Then MsgBox "Macro Geannuleerd" Exit Sub Else 'Write to file On Error GoTo Handler: Set ts = FSO.OpenTextFile(Fname1, 2, True, -2) 'Parameters: FileName, For Writing, Create n
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta microsoft access bad filename or number Discuss the workings and policies of this site About Us Learn
Error 52 Driver
more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us bad filename or number access import Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, http://www.mrexcel.com/forum/excel-questions/393788-error-53-open-filename-output.html helping each other. Join them; it only takes a minute: Sign up Code 800A0005 when using set objFile = objFSO.OpenTextFile up vote 3 down vote favorite I have searched this error code numerous times and have gone to numerous sites to read responses. Long story short, still haven't found a solution. One page referenced: Error while sending http://stackoverflow.com/questions/20294561/code-800a0005-when-using-set-objfile-objfso-opentextfile ( character with sendkeys in vbscript Here is my code: set WshShell = WScript.CreateObject("WScript.Shell") Return = WshShell.Run("C:\Downloads\software\putty.exe -load navstat") DIM date date = 301113 DIM tran1 tran1 = TAFFY set objFSO = CreateObject("Scripting.FileSystemObject") set objFile = objFSO.OpenTextFile("C:\Users\Adrian\Desktop\Entries1.txt", ForReading) Do Until objFile.AtEndOfStream strLine = objFile.ReadLine If InStr(strLine, "JFK.GREKI3.MARTN..TOPPS") Then set indi = 2 set tran1 = TOPPS End If Loop What's going on: I am scanning a .txt file (Entries1.txt) for text strings. If they occur I need to set corresponding indi values (so when indi is used later as a variable it will use the correct #) and change the tran1 variables as well. For some reason I'm getting an error at: set objFile = objFSO.OpenTextFile The error is Invalid procedure call or argument Code: 800A0005 Help would be greatly appreciated. vbscript share|improve this question edited Nov 29 '13 at 23:31 asked Nov 29 '13 at 23:11 Adrian 2916 3 If you're getting the error at the line you indicate, all of the code beyond that is irrelevant
Forums >Programming >ASP Development VB problem with run-time error 53 -- file not found Discuss VB problem with run-time error 53 -- file not found in the ASP Development forum http://forums.devarticles.com/asp-development-3/vb-problem-with-run-time-error-53----file-not-found-67598.html on Dev Articles. VB problem with run-time error 53 -- file not found ASP Development forum discussing your ASP or Visual Basic problems, solutions and code posts. Active Server Pages help you create dynamic websites using powerful scripting technologies. Add This Thread To: Del.icio.us Digg Google Spurl Blink Furl Simpy Y! MyWeb « Previous Thread | error 52 Next Thread » Thread Tools Search this Thread Display Modes Dev Articles Community Forums Sponsor: #1 August 13th, 2006, 05:31 PM Robert Krebs Registered User Join Date: Aug 2006 Posts: 1 Time spent in forums: 16 m 31 sec Reputation Power: 0 VB problem with run-time error 53 -- file not found I've written runtime error 52 code that works to open a text file and read its contents. When I try to place the file spec into a variable and use the variable as an argument to GetFile or OpenTextFile, I get this error. Can anyone tell me what the issue is? Thanks! This version works: Function LoadFile(Filespec As String) Dim oFSO Dim f Set oFSO = CreateObject("Scripting.FileSystemObject") f = oFSO.getfile("C:\eq loc.dat") .... End Function This version does not work: Function LoadFile(Filespec As String) Dim oFSO Dim f Set oFSO = CreateObject("Scripting.FileSystemObject") f = oFSO.getfile(Filespec) .... End Function Robert Krebs View Public Profile View Extended RPG Stats Challenge This User To Battle Send a private message to Robert Krebs Find all posts by Robert Krebs Find all threads by Robert Krebs Add Robert Krebs to Your Buddy List Viewing: Dev Articles Community Forums >Programming >ASP Development > VB problem with run-time error 53 -- file not found « Previous Thread | Next Thread » Developer Shed Advertisers and Affiliates Thread Tools Email this Page Display Modes Linear Mode Switch to Hybrid Mode Switch to Threaded Mode Search this Thread Advanced Search Rate This Thread