Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 86
  • Last Modified:

Cpile error on 64 bit machine

Folks,
I am running Windows 7/64 and Office 2013/64
In Excel I'm following some provided code designed to help automated charts. When I enter in this code:
Sub declareI get his error:
compile errorMicrosoft's help was useless.
0
Frank Freese
Asked:
Frank Freese
2 Solutions
 
John HurstBusiness Consultant (Owner)Commented:
Office 64-bit does not interact well (or sometimes at all) with 32-bit applications surrounding it. Microsoft does not really recommend Office 64-bit at this point.

Do you have a machine with Windows 7 64-bit and Office 2013 32-bit that you can try.  I expect this will be the answer.
0
 
Frank FreeseAuthor Commented:
All my machines run 64 but Windows / Office
0
 
John HurstBusiness Consultant (Owner)Commented:
You are probably going to upgrade to 64-bit as suggested by the error message. I think your only alternatives are 64-bit code or 32-bit Office.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
Rory ArchibaldCommented:
It's a pretty simple change to make it 32 and 64bit compatible:

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

Open in new window

0
 
jkpieterseCommented:
If you have more API function declarations to update so they work on 64 bit Office, check out my article on this:
www.jkp-ads.com/articles/apideclarations.asp
0
 
Frank FreeseAuthor Commented:
thanks folks
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

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

Tackle projects and never again get stuck behind a technical roadblock.
Join Now