VBA-tools/VBA-Web

Can't compile

Closed this issue · 17 comments

I'm unable to get this to compile on Office 2010 x64 or Office 2013 x64. Anybody else having this issue?

Hi @dsrlb, I've been meaning to test Excel-REST with 64-bit Excel since adding the timer functionality. Is it giving any details on what is causing it to fail to compile? (My guess it's SetTimer or KillTimer in RestHelpers)

Looking back at the source for the timer implementation, SetTimer and VBA, I think it may be the LongLong datatype, which I thought was a typo. I'll post a patch and see if that fixes the compilation issue.

@dsrlb Will you replace RestHelpers in your project with the following updated version and see if it resolves the compilation error?

https://raw2.github.com/timhall/Excel-REST/64-bit-compile/src/RestHelpers.bas This code has been merged in version 2.1.3 and later

Thanks for the quick response!

I'll try, but I'm not sure if I get that far. I'm getting an error on the module text "Version 1.0 CLASS". Yes, I did import the file, not add it.

I did go back and add some conditional compilation stuff for the declare statements.

That's definitely strange that Excel's not automatically removing the Version 1.0 CLASS and other header information on import, that would definitely cause an issue. I would recommend removing any of the files that still have that info and re-importing. Do you mind opening up the Blank Excel-REST workbook that includes just the Excel-REST files and seeing if you have the same issue with compiling it?

Sorry, didn't mean to close it.

Based on the screenshot, it looks like something went awry during the import because the files listed should be in a Classes folder rather than the Modules folder. I would try removing them and re-importing and see if they are put in the Classes folder

I'm able to get it to compile by doing the following:

  1. Use the Blank Excel-REST workbook
  2. Remove the RequestHelpers module
  3. Replace the RequestHelpers.bas code with the code listed above
  4. Import the new RequestHelpers.base file

Off to see if I can get the example GetDirections code to work.

I've gotten it to work successfully with the new version of the RequestHelpers module and the Google GetDirections code.

Next question, any ideas on why those classes won't import properly with Excel 2010 x64 or Excel 2013 x64?

Ideally we would like to be able to import them into another workbook application and use them.

I wonder if it's something in the header making it incompatible. Will you export the RestRequest class from the working Excel file and paste the header from that exported file here so that I can see if anything is different?

Here's the export of the RestRequest.cls file form the working workbook:

VERSION 1.0 CLASS
BEGIN
  MultiUse = -1  'True
END
Attribute VB_Name = "RestRequest"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = True

(trimmed your response to fit better) Thanks for checking for me, I'll add that in and see how it affects the 32-bit version

@dsrlb Split off this particular issue into a new one since compiling is working now.

Code listing returns 500 Internal error. Can You repost it?
EDIT:
Never mind, that code was merged, right? (I'm using 2.3.0)

@przemoli Yes, this code has been merged and is included in version 2.1.3 and later

I had the same problem as @dsrlb, because I copy-pasted the .cls/.bas files into Microsoft Access, instead of importing them with Import file...
The lines that cause error should not be there if you import the files.