Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Run-time error '-2147221080 (800401a8)': Automation error Ronald R. Dodge, Jr.[_2_] Excel Programming 1 April 2nd 09 05:37 PM
Compile error: Automation error in Excel 97 Geoff Excel Programming 3 July 1st 08 07:20 AM
Urgent!!! Run-time error '-2147024770 (8007007e)' Automation error [email protected] Excel Programming 3 May 28th 08 04:51 AM
Run-Time Error'-2147221080(800401a8)': Automation Error BEEJAY Excel Programming 1 July 18th 06 03:13 PM
Unknown where is the problem on the Runtime error - Automation error wellie Excel Programming 1 July 10th 03 08:12 AM


All times are GMT +1. The time now is 07:48 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"