I working on VBA with Excel, Which working fine with windows OS (32 bit) 
and office 2007(office 32 bit) When i started work on Windows 8 (64 bit) 
and office 2010 (64 bit) i was unable to run the application so for below 
line of code i added because of excel office 2010 is comes with VBA7.

#If VBA7 Then
Declare PtrSafe Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As LongPtr)
#Else
Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
#End If

#If VBA7 Then
Declare PtrSafe Function CreateFile Lib "kernel32" Alias "CreateFileA" (ByVal 
lpFileName As String, ByVal dwDesiredAccess As LongPtr, ByVal dwShareMode As 
LongPtr, ByVal lpSecurityAttributes As Any, ByVal dwCreationDisposition As 
LongPtr, ByVal dwFlagsAndAttributes As LongPtr, ByVal hTemplateFile As LongPtr) 
As Long
Declare PtrSafe Function WriteFile Lib "kernel32.dll" (ByVal hFile As LongPtr, 
ByRef lpBuffer As Any, ByVal nNumberOfBytesToWrite As LongPtr, ByRef 
lpNumberOfBytesWritten As LongPtr, ByRef lpOverlapped As LongPtr) As Long
Declare PtrSafe Function ReadFile Lib "kernel32" (ByVal hFile As LongPtr, ByRef 
lpBuffer As Any, ByVal nNumberOfBytesToRead As LongPtr, ByRef 
lpNumberOfBytesRead As LongPtr, ByRef lpOverlapped As Any) As Long
Declare PtrSafe Function CloseHandle Lib "kernel32.dll" (ByVal hObject As 
LongPtr) As Long
#Else
Declare Function CreateFile Lib "kernel32" Alias "CreateFileA" (ByVal 
lpFileName As String, ByVal dwDesiredAccess As Long, ByVal dwShareMode As Long, 
ByVal lpSecurityAttributes As Any, ByVal dwCreationDisposition As Long, ByVal 
dwFlagsAndAttributes As Long, ByVal hTemplateFile As Long) As Long
Declare Function WriteFile Lib "kernel32.dll" (ByVal hFile As Long, ByRef 
lpBuffer As Any, ByVal nNumberOfBytesToWrite As Long, ByRef 
lpNumberOfBytesWritten As Long, ByRef lpOverlapped As Long) As Long
Declare Function ReadFile Lib "kernel32" (ByVal hFile As Long, ByRef lpBuffer 
As Any, ByVal nNumberOfBytesToRead As Long, ByRef lpNumberOfBytesRead As Long, 
ByRef lpOverlapped As Any) As Long
Declare Function CloseHandle Lib "kernel32.dll" (ByVal hObject As Long) As Long
#End If

*it worked fine But when i try to Access the Application(excel sheet) i am 
getting *

*Error "Runtime Error 429 - ActiveX Component Can't Create Object "*


*My Problem* :* I Have Issue only with 64 bit Windows 8 and 64 bit Office 
2010 *
1. did any mistake in above Declared Code ?
2. Can force to run 32 bit COM object on 64 bit OS and How ?

*Here creating the COM Object*

Dim objScript As New ScriptControl

Dim objNavFunctions As New NavFunctions
....
objScript.Language = "vbscript" ' **// here getting error

-- 
Are you =EXP(E:RT) or =NOT(EXP(E:RT)) in Excel? And do you wanna be? It’s 
=TIME(2,DO:IT,N:OW) ! Join official Facebook page of this forum @ 
https://www.facebook.com/discussexcel

FORUM RULES

1) Use concise, accurate thread titles. Poor thread titles, like Please Help, 
Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get 
quick attention or may not be answered.
2) Don't post a question in the thread of another member.
3) Don't post questions regarding breaking or bypassing any security measure.
4) Acknowledge the responses you receive, good or bad.
5) Jobs posting is not allowed.
6) Sharing copyrighted material and their links is not allowed.

NOTE  : Don't ever post confidential data in a workbook. Forum owners and 
members are not responsible for any loss.
--- 
You received this message because you are subscribed to the Google Groups "MS 
EXCEL AND VBA MACROS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to excel-macros+unsubscr...@googlegroups.com.
To post to this group, send email to excel-macros@googlegroups.com.
Visit this group at http://groups.google.com/group/excel-macros?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to