Home Image-Pro Automation (Macros, Apps, Reports)

REFERENCES and IMPORTS for EXCEL . . .

All --

I have an APP that uses the following statement

        'Attempt to connect with excel
        Dim MyExcelApp As Microsoft.Office.Interop.Excel.Application = _
            System.Runtime.InteropServices.Marshal.GetActiveObject("Excel.Application")

When I copy the SUBROUTINE that includes this statement into a new PROJECT, and the LOAD the PROJECT, PREMIER complains that

    "type identifier is invalid"

at character 69 (just before the = sign).

I have EXPORTED all of the DEPENDENCIES from the WORKING PROJECT and and IMPORTED them to the NEW PROJECT and I have copied all of the IMPORT STATEMENTS from the WORKING PROJECT to the NEW PROJECT but obviously something is missing.

Can one of you GURUs point me in the right direction please?

Thanks.

-- Matt





Best Answer

  • Answer ✓
    Hi Matt,

    I think we talk about this earlier, but just in case, you need add reference to  Microsoft.Office.Interop.Excel.dll.
    Thanks,
    Nikita.
    
    

Answers

  • Nikita --

    Thank you.

    Per your suggestion, I have added this REFERENCE and the ERROR is gone.

    Souldn't the REFERENCE EXPORT from the WORKING PROJECT and REFERENCE IMPORT into the NEW PROJECT have resolved this?

    Thanks.

    -- Matt
  • Matt, I suspect, reference export/import supports only MediaCy modules. Working with Excel application directly is beyond standard macro functionality and should be handled manually.

    Nikita.
  • Nikita --

    Thank you for this additional information.

    If this is confirmed to be the case, then perhaps it would be wise to make a prompt that tells the EXPORTER / IMPORTER that anything not MEDIACY will have to be handled manually.

    Thanks again.

    -- Matt
Sign In or Register to comment.