Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

runtime error '453' Can't find DLL entry point GetCurrentDirectory in kernel32

Posted on 2003-12-08
Last Modified: 2008-02-01
i'm attempting to make a GetCurrentDirectory function call in my form_load routine but get the error stated in the subject

any help would be appreciated!!!

the following is my code

Private Declare Function GetCurrentDirectory Lib "kernel32" ( _
                                  ByVal nBufferLength As Long, _
                                  ByVal lpBuffer As String) As Long

Public strPath as String

Private Sub Form_Load()
Dim lngTemp As Long
  strPath = String(255, 0)
  lngTemp = GetCurrentDirectory(255, strPath)
  MsgBox strPath
End Sub
Question by:howardsd
  • 2
  • 2
LVL 12

Accepted Solution

vascov earned 50 total points
ID: 9900360
Hi howard,

try this:

Public Declare Function GetCurrentDirectory Lib "kernel32" Alias "GetCurrentDirectoryA" (ByVal nBufferLength As Long, ByVal lpBuffer As String) As Long


Author Comment

ID: 9900368
figured it out! had to declare the function uising an alias of "GetCurrentDirectoryA"

Private Declare Function GetCurrentDirectory Lib "kernel32" Alias "GetCurrentDirectoryA" (ByVal nBufferLength As Long, ByVal lpBuffer As String) As Long


Author Comment

ID: 9900386
u beat me by 1 minute!

LVL 12

Expert Comment

ID: 9900482

Glad that you found it!

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
VB error "Type mismatch" 2 60
using Access 8 75
Spell Check in VB6 13 127
how to Classify of email (pdf attachments) 7 45
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question