473,396 Members | 1,780 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

getting runtime error 52 bas file name or number

Q: getting runtime error 52 bas file name or number

D:
Expand|Select|Wrap|Line Numbers
  1. Public Function gf_ChkMkDir(iDirPath As String, iDirName As String) As Boolean
  2. Dim MyPath As String
  3. gf_ChkMkDir = False
  4. MyPath = Dir(iDirPath & "\" & iDirName & "\", vbDirectory)
  5. If MyPath = vbNullString Then
  6.  
  7.     MkDir (iDirPath & "\" & iDirName)
  8. End If
  9. gf_ChkMkDir = True
  10. End Function
  11. Public Function g_OnError(ByVal FileDesc As Integer, ByVal ErrNumber As Double, ByVal ErrDescription As String, Optional ByVal Status As String)
  12. If Status = "" Then
  13.     MsgBox ErrDescription & " - " & Err.Description
  14.     Print #FileDesc, ErrDescription & " - " & Err.Description
  15.     End
  16. Else
  17.     Print #FileDesc, ErrDescription & " - " & Err.Description
  18. End If
  19.  Close #FileDesc
  20. End Function
Dec 19 '13 #1
1 1537
zmbd
5,501 Expert Mod 4TB
mishika:
Since this is your first post, I'll be gentile:
You haven't set the file pointer.
I'll assume that the error is happeing around line 14 in the posted code as currently formatted.

Please read the following Insight Article:
VBA Standard Text File I/O Statements

Next:
Posted code without explanation or question. Please read the FAQ and posting guidlines before reposting your question.

By, simply stating that your code "doesn't work," along with code that appears to have had very little if any troubleshooting performed, and expecting someone to help doesn't usually result in much of an answer and may result in your thread being deleted.

In the future, please tell us what you were expecting to happen, what actually happened, for each error: the EXACT title, error number, and descriptions that occurred and at what line in your posted code the error occurred. Script (VBA or SQL, etc) must be formated using the [CODE/] format button, formatted tables will also benefit from this as they will retain the spacing).
These are the minimum requirements for posting a question of this nature.
Dec 19 '13 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: David C. Holley | last post by:
Is there a function in VBScript that will return the name of the file that is currently being executed? Basically, I'm looking for a function that I can use in code similar to this... <%...
6
by: Bill Patel | last post by:
I am getting Runtime error on line 50. Please Help. Thank You Bill 1 <%@ Page Language="VB" %> 2 <%@ import Namespace="System.Data" %> 3 <%@ import Namespace="System.Data.SqlClient"...
4
by: Pat | last post by:
In my Web.config i have :- <customErrors mode="On" defaultRedirect="genericerror.htm"> <error statusCode="404" redirect="pagenotfound.aspx"/> </customErrors to get page not found error but...
7
by: ruvi | last post by:
I am getting runtime error 3021 - Either EOF or BOF is true or the current record has been deleted..... I have 2 combo boxes in a form- One for the client and the other for the project. When the...
7
by: opie | last post by:
I created this program on Vista using VB 6.0 with Access as the DB. When I created the executable and was trying to use it, on a XP machine, it gave me two issues. The first problem was it was...
1
by: Lauren Dobson | last post by:
This database was working days ago, outputting a vocabulary list into a word document. Any idea why I'm getting runtime error 3010? I just switched from Windows XP to Windows 7 but I'm still using...
2
by: Chocolade | last post by:
Thats not the complete code but thats the line givem e the exception: using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing;
14
by: rahulwagh | last post by:
Hi, I have written one macro in excel 2010. I am trying to save the excel file using below code Application.Workbooks(Dir(reportName)).SaveAs Here report name is the compelte path of the file ...
1
by: creation | last post by:
$b= 1; while($b) { $a = <>; if($a eq 42) break; else { print $a; }
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.