close
Hello

I am trying to use thi following macro but I get an error saing KERNEL
cannot be found and this occurs at the macro line quot; y= ......quot;

What I am doing wrong?
I am Using WindowXP Professional and Excel 2003

'The following two declare statements need to be entered each on a single
'line in the module sheet.

Declare Function GetSystemDirectory Lib quot;KERNELquot; (ByVal lpBuffer As String,
ByVal nSize As Integer) As Integer

Declare Function GetWindowsDirectory Lib quot;KERNELquot; (ByVal lpBuffer As String,
ByVal nSize As Integer) As Integer

Sub GetDir()
'sets the buffer length for both variables to 144
Dim Win_Dir As String * 144
Dim Sys_Dir As String * 144
'returns the \Windows directory
y = GetWindowsDirectory(Win_Dir, Len(Win_Dir))
'Displays the windows directory in a Message box
MsgBox Win_Dir
'Returns the Windows\System directory
x = GetSystemDirectory(Sys_Dir, Len(Win_Dir))
'Displays the \Windows\System directory in a Message box
MsgBox Sys_Dir
End Sub

thanks for the help
Francesco

Declare Function GetSystemDirectory Lib quot;KERNEL32.DLLquot; Alias
quot;GetSystemDirectoryAquot; _
(ByVal lpBuffer As String, ByVal nSize As Integer) As Integer

Declare Function GetWindowsDirectory Lib quot;KERNEL32.DLLquot; Alias
quot;GetWindowsDirectoryAquot; _
(ByVal lpBuffer As String, ByVal nSize As Integer) As Integer

HTH
--
AP

quot;Francescoquot; gt; a écrit dans le message de
...
gt; Hello
gt;
gt; I am trying to use thi following macro but I get an error saing KERNEL
gt; cannot be found and this occurs at the macro line quot; y= ......quot;
gt;
gt; What I am doing wrong?
gt; I am Using WindowXP Professional and Excel 2003
gt;
gt; 'The following two declare statements need to be entered each on a single
gt; 'line in the module sheet.
gt;
gt; Declare Function GetSystemDirectory Lib quot;KERNELquot; (ByVal lpBuffer As
String,
gt; ByVal nSize As Integer) As Integer
gt;
gt; Declare Function GetWindowsDirectory Lib quot;KERNELquot; (ByVal lpBuffer As
String,
gt; ByVal nSize As Integer) As Integer
gt;
gt; Sub GetDir()
gt; 'sets the buffer length for both variables to 144
gt; Dim Win_Dir As String * 144
gt; Dim Sys_Dir As String * 144
gt; 'returns the \Windows directory
gt; y = GetWindowsDirectory(Win_Dir, Len(Win_Dir))
gt; 'Displays the windows directory in a Message box
gt; MsgBox Win_Dir
gt; 'Returns the Windows\System directory
gt; x = GetSystemDirectory(Sys_Dir, Len(Win_Dir))
gt; 'Displays the \Windows\System directory in a Message box
gt; MsgBox Sys_Dir
gt; End Sub
gt;
gt; thanks for the help
gt; Francesco
arrow
arrow
    全站熱搜

    software 發表在 痞客邦 留言(0) 人氣()