2 Replies Latest reply on Apr 17, 2012 7:59 AM by KuddRoww

    InDesign and Excel

    frameexpert Level 4

      Background: I have a localised InDesign file with a bunch of English "terms" identified by character styles. I need to find each term in the document and look it up in an Excel spreadsheet. When I find a match in the spreadsheet, the ajoining cell will have the correct value for that term. I then replace the term in the InDesign document with the value from the spreadsheet. My question here is, what is the best way to interact with Excel spreadsheets with InDesign scripting. I normally use JavaScript for the scripting language, but does VB give me more options for getting access to the spreadsheet? Or, should I build a NET application that will control both Excel and InDesign. I am mainly looking for some pointers for best practices for working with Excel and InDesign. This will give me a starting point for designing my solution.

       

      In a FrameMaker/FrameScript environment, I have a couple of choices. I can FrameScript to access Excel as a COM (ActiveX) object and get at its data. Or, I can use ADODB and query the spreadsheet with SQL commands. Are either of these choices available to me with InDesign scripting?

       

      Thanks in advance.

       

      Rick

        • 1. Re: InDesign and Excel
          John Hawkinson Level 5
          My question here is, what is the best way to interact with Excel spreadsheets with InDesign scripting. I normally use JavaScript for the scripting language, but does VB give me more options for getting access to the spreadsheet?

          I think you know that it does.

           

          It's really impossible to say whether you're better off using VB or .NET. Or even writing the ID side in JavaScript and having it call out to the Microsoft side written in whatever.

           

          One observation is that COM+ and .NET access to InDesign has some rough edges, and is not well documented, and you won't find a lot of support for it here. (Not that there are a huge number of VB users here, but there are some.) But I think it's really about your comfort in those environments.

          • 2. Re: InDesign and Excel
            KuddRoww Level 1

            What is the scale of the solution? For a little old operation I do this with CSV files. I just ingest the CSV line by line and then I split it tab by tab. Then I search one column for the word and replace it with the value stored in the following column.

             

            Find     0             Replace    1

            _____________|____________

            Harper                Rae

            Reford                Sherman

             

            Run a loop to see if the document contains the string stored in the array and replace.

             

            It's not pretty, it would probably make some computer scientists vomit, but it's a dirt cheap and mindless way to manage content for me.