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

Selecting WORKBOOK (.XLS OR XLSX FILE) and WORKSHEET as destiation for EXPORTTOEXCEL or SENDTOEXCEL

All --

Is there a way for an IPP9 APP to ask WIN/EXCEL to open a designated WORKBOOK from a file, select a designated WORKSHEET within the WORKBOOK, perform the appropriate SENDTOEXCEL or EXPORTTOEXCEL into the selected WORKSHEET, and then SAVEAS (and close) the WORKBOOK?

Background . . .

I've built an EXCEL WORKBOOK that contains several EXCEL WORKSHEETS.

I would like to use the

    MediaCy.Automation.Measure.Measurements.TableCommands.SendToExcel.
    or
    MediaCy.Automation.Measure.Data.ExportCommands.ExportToExcel

command to transfer data from within IPP9 to the appropriate EXCEL WORKSHEET within the appropriate EXCEL WORKBOOK.

I've poked around within the HELP files, done some searching on the web, and attempted to RECORD MACRO but so far the code examples I've gotten do not get me what I'm looking for.  I've also tried to use some code that worked to control EXCEL from a VB EXE that was also controlling IPP7 and there seems to be a linkage between IPP9 and EXCEL that has not been established.

Thanks.

-- Matt

Best Answers

  • Answer ✓
    Matt, I’ve created several examples to control Excel from the macro. You can use ExportToExcel command after selecting active worksheet (SelectWorksheet macro) and command will use active worksheet as destination.
  • Answer ✓
    Project
  • Answer ✓
    Script tab -> Project group -> References

Answers

  • edited August 2013

    Hi Matt,

    Take a look on the FileName, FileOptions and Visible properties of the ExportToExcel. You can configure this command to export in the file without even showing the Excel. However, there is no option to select the active worksheet. But if you open Excel in advance on the destination worksheet from the code and then the ExportToExcel command will export the data in the active worksheet.

  • Yuri --

    Thank you for your suggestion.

    I will try to implement and reply ASAP.

    Thanks again.

    -- Matt
  • Yuri --

    Is there an existing IPP9 MACRO or APP that does this that I can use as a guide for connecting with and controlling EXCEL from with IPP9?

    I've tried several VB.NET based examples for connecting with and controlling EXCEL from within VB.NET.

    I'm getting errors that I cannot track down.

    I've also searched The closest I could come is

        BenchmarkingTools

    from

        C:\Users\Public\Documents\Image-Pro Premier 64-bit (Shared)\Scripts\Benchmarking Tools

    but this does not run on my computer and my attempts at using this as an example have failed.

    Thanks.

    -- Matt




  • NikitaRG --

    Thank you very much for the IPX file and the example it contains.

    I think I'll be able to use it to add the EXCEL functionality my program needs.

    I think that part of the reason that my attempts were failing was that my IPP file does not contain the following DLL link that your Project1.IPP file contains.

    '#Reference #Microsoft.Office.Interop.Excel, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c, processorArchitecture=MSIL, Path=C:\Program Files\Media Cybernetics\Image-Pro Premier\Microsoft.Office.Interop.Excel.dll

    Can you please tell me (us) how this was added to your PROJECT?

    Thanks again.

    -- Matt
  • NikitaRG --

    Thank you very much.

    That is PERFECT.

    I hope I'll be able to return the favor someday.

    Also . . .

    Sorry I did not address you directly after your contribution yesterday.  My brain was fried and thought that information had come from Yuri.

    Thanks again.

    -- Matt
  • All --

    Here is a chance for me to repay the FAVOR BANK . . .

    While working with the code provided by NIKITARG, I needed XLMINIMIZED and XLMAXIMIZED to be defined so that I could use

        excel.windowstate = xlMinimized
        and
        excel.windowstate = xlMaximized

    I found a TXT file formatted to DECLARE and SET variables / keywords used to control EXCEL and it is attached as

        XL97CONS.TXT

    This TXT file was within

        XL97Constants.zip

    at

        http://techsupt.winbatch.com/ts/T000001033005F9.html

    I hope this information is helpful.

    -- Matt
  • Another way to find Excel commands and constants is to activate macro recording in Excel and do the steps you want to use. Then this macro can be used in Premier (adding "excel." prefix when necessary).
     
  • Yuri --

    Thanks for the suggestion.

    I found out yesterday that the OFFICE / EXCEL that I have (OFFICE 365 (v15)) does not support MACROS so I'll have to get a different version to take your suggestion.

    -- Matt
Sign In or Register to comment.