Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
GetLocaleInfo Automation Error
Hi everyone. In this code, when it reaches the line GetLocaleInfo, it displays
Run-time error '2147417848' Automation Error The object invoked has disconnected from its clients. Could somebody please tell me what's wrong? I'm using WinXP, MS Excel 2003. Thanks in advance! Private Const LOCALE_SSHORTDATE As Long = &H1F Private Declare Function GetSystemDefaultLCID Lib "kernel32" () As Long Private Declare Function GetLocaleInfo Lib "kernel32" _ Alias "GetLocaleInfoA" _ (ByVal Locale As Long, _ ByVal LCType As Long, _ lpLCData As String, _ ByVal cchData As Long) As Long Private Sub GetInfo Dim lcid As Long lcid = GetSystemDefaultLCID() Dim format As String Dim temp As Long temp = GetLocaleInfo(lcid, LOCALE_SSHORTDATE, format, 256) End Sub |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
GetLocaleInfo Automation Error
I know now where the prob was. I forgot to put ByVal in lpLCData parameter.
"jean grey" wrote: Hi everyone. In this code, when it reaches the line GetLocaleInfo, it displays Run-time error '2147417848' Automation Error The object invoked has disconnected from its clients. Could somebody please tell me what's wrong? I'm using WinXP, MS Excel 2003. Thanks in advance! Private Const LOCALE_SSHORTDATE As Long = &H1F Private Declare Function GetSystemDefaultLCID Lib "kernel32" () As Long Private Declare Function GetLocaleInfo Lib "kernel32" _ Alias "GetLocaleInfoA" _ (ByVal Locale As Long, _ ByVal LCType As Long, _ lpLCData As String, _ ByVal cchData As Long) As Long Private Sub GetInfo Dim lcid As Long lcid = GetSystemDefaultLCID() Dim format As String Dim temp As Long temp = GetLocaleInfo(lcid, LOCALE_SSHORTDATE, format, 256) End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Run-time error '-2147221080 (800401a8)': Automation error | Excel Programming | |||
Compile error: Automation error in Excel 97 | Excel Programming | |||
Urgent!!! Run-time error '-2147024770 (8007007e)' Automation error | Excel Programming | |||
Run-Time Error'-2147221080(800401a8)': Automation Error | Excel Programming | |||
Unknown where is the problem on the Runtime error - Automation error | Excel Programming |