Menu

Supporting 64bit Excel

Jungho Lee
2013-03-08
2013-03-15
  • Jungho Lee

    Jungho Lee - 2013-03-08

    I'd like that Excelsi-R would support 64bit Excel. Then I am trying to change some code of VBA and C code.

    But, current Code of sourceforge does not seem to include all files for C dll. When I tried to compile C code, there was comiling error like 'missing file boost/format.hpp'. Is it just ignorable?

    Or if you already have a version with supporting 64bit, could I test that? Thanks,

     

    Last edit: Jungho Lee 2013-03-08
  • Ben Escoto

    Ben Escoto - 2013-03-08

    The boost/format.hpp file is part of the boost library. Documentation on format is available here:

    http://www.boost.org/doc/libs/1_53_0/libs/format/doc/format.html

    Many boost libraries, including format, are header-only, so it should be easy for you to install.

    About 64 bit support, I don't have a machine with 64-bit Windows available for testing. I would appreciate any work you do looking into 64-bit Windows support!

     
  • Jungho Lee

    Jungho Lee - 2013-03-11

    Thanks, I am trying to support for 64 Windows support.

    For VBA - 64bit Excel needs to use PtrSafe keyword for Declare statement.

    For C - I am trying but it is missing dllmain.cpp, which I guess include definition for below.
    Public Declare Sub setExcelApp Lib "Excelsi-R" (ByVal pExcelApp As Variant)

    Would you please check a C source including setExcelApp? Thanks,

     
  • Ben Escoto

    Ben Escoto - 2013-03-12

    Thanks for your interest. I'm not sure I understand your question, but I think there may be version mixup. If you are looking at the current source code, then the setExcelApp function has been renamed excelsir_set_excel. Here's the relevant VBA code from

    https://sourceforge.net/p/excelsir/code/ci/7b46dd227980b86e9d28a9239b93ee8a7dafa4e4/tree/Excel/modAutoResize.vba

    Public Declare Sub excelsir_set_excel Lib "Excelsi-R" _
        (ByVal pExcelApp As Variant)
    
    Sub Auto_open()
        'pass the pointer to the Excel Application object to the dll
        excelsir_set_excel Application
    End Sub
    

    Here is the related C code from

    https://sourceforge.net/p/excelsir/code/ci/7b46dd227980b86e9d28a9239b93ee8a7dafa4e4/tree/Excelsi-R/AutoResize.cpp

    EXCELSIR_API void __stdcall excelsir_set_excel(VARIANT pExcelApp) {
      // Logger::init();
      // Logger::write("In setExcelApp.\n");
      ExcelEventDispatcher = new TExcelEventDispatcher();
      ExcelEventDispatcher->Connect(pExcelApp.pdispVal);
    } 
    

    Hope this helps. If not, let me know.

     
  • Jungho Lee

    Jungho Lee - 2013-03-12

    Got it. I missed the latest code and using files. Stupid! Investigating with the latest code right now. Thanks,

     
  • Jungho Lee

    Jungho Lee - 2013-03-13

    While 32bit compiled dll is not recognised into 64bit Excel, 64bit compiled dll is loaded into 64bit Excel. And excelsir_set_excel with just ptrsafe works without any problem.
    But, excelsir_get_conn does not work. It results in Excel crush.
    I guess it is related to RconnCType type. To figure out the root, I am debugging now. Hopefully, it should be solved easily. Thanks,

     
  • Jungho Lee

    Jungho Lee - 2013-03-15

    Tried for 2 days. But I don't find a way to pass variables of string(hostname) and int(port) from VBA to VC. I have tried several combinations but no thing pass over. String is not passed and number is also not passed correctly. A couple of days has been spent with no sucess.
    I think I don't have a knowledge to solve the 64 bit stuff.
    I guess the task could be done for a couple of weeks. For now, I don't have that much time and so I am recommending my customer to change the office to 32 bit version from 64bit.
    Some day I will revisit this issue since it is a hill which must be overcome. Or somebody will do. Thanks,

     
  • Ben Escoto

    Ben Escoto - 2013-03-15

    Yes, Microsoft makes things very challenging. Because of strange encoding conventions it is frustrating to pass even simple types back and forth. For instance, that is why in the code strings are converted to variants---if you don't wrap your strings in variants OLE will mangle them. Also there are many different types of strings (char , wchar , C++ strings, BSTR, LPSTR, etc). When I was coding it I was basically forced to always copy/paste someone else's answer.

    Anyway, thanks for your efforts.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.