5 Replies Latest reply on Oct 29, 2009 4:50 AM by ldb68

    (CS3) Is the "rangeName" property of Application.ExcelImportPreference really broken?

    Mike.Edel Level 1

      Hi all,

       

      I'm desperately trying to set the rangeName property of Application.ExcelImportPreference(s).

      It will not stick but only last until after the next import (and only if the import is without setting options manually)

       

      What I want to do is to get around the fact that updating a linked excel file in InDesign will completely ignore the cell range that was set when placing it. We have a complicated excel sheet with a lot of junk in front of and after the (for us) interesting part. We can leave that out when placing it via setting cell range but we really would like to be able to update the links as usual without messing up the whole table.

       

      My idea was to set the preference, update, and reset it back to its default value.

      Funny enough, the property is not there in the Data Browser:

      screenshot.png

      After I set it, I can see it until I place another file.

       

      Any ideas? (btw: if there is an easier way to fix the update problem that would of course be appreciated, too)

       

      Thanks

       

      Mike

        • 1. Re: (CS3) Is the "rangeName" property of Application.ExcelImportPreference really broken?
          AdobeScripts Level 3

          hi

           

          yeah, InDesign don't store full info about ImportPreferences with placed object - but should do this and use it later ...

           

          you need to save these preferences yourself - for example using Label(s) - and make your own script to update saved range

           

          robin

           

          www.adobescripts.co.uk

          • 2. Re: (CS3) Is the "rangeName" property of Application.ExcelImportPreference really broken?
            Mike.Edel Level 1

            Hi Robin,

             

            that explains my problems.

            I was hoping that InDesign would use Application.ExcelImportPreference.rangeName when updating my placed Excel file.

            But since it doesn't store the value its clear why it never did.

             

            Fortunately, Bob Levine pointed me towards a solution: using named ranges in Excel and placing those ranges in InDesign works perfectly.

             

            Thanks,

             

            Mike

            • 3. Re: (CS3) Is the "rangeName" property of Application.ExcelImportPreference really broken?
              ldb68

              Hi Mike


              "using named ranges in Excel and placing those ranges in InDesign works perfectly"

               

              Can you share a sample?

               

              I Use   myTextFrame.Place(myExcelFile)  with preset and "rangeName" dosen't work

               

              Rem Sets the Excel import filter preferences.
              With myInDesign.ExcelImportPreferences
                  Rem alignmentStyle property can be:
                  idSpreadsheet = &H73707273
                  idLeftAlign = &H6C656674
                  idRightAlign = &H72676874
                  idCenterAlign= &H63656E74
                  myInDesign.ExcelImportPreferences.AlignmentStyle = idSpreadsheet
                  myInDesign.ExcelImportPreferences.DecimalPlaces = 2
                  myInDesign.ExcelImportPreferences.PreserveGraphics = False
                  Rem Enter the range you want to import as "start cell:end cell".
                  myInDesign.ExcelImportPreferences.rangeName = "A1:B3"
                  REM myInDesign.ExcelImportPreferences.SheetIndex = 1
                  REM myInDesign.ExcelImportPreferences.SheetName = "Foglio1"
                  myInDesign.ExcelImportPreferences.ShowHiddenCells = False
                  Rem tableFormatting property can be:
                  idExcelFormattedTable = &H786C4654
                  idExcelUnformattedTable = &H786C5554
                  idExcelUnformattedTabbedText = &H78555454
                  myInDesign.ExcelImportPreferences.TableFormatting = idExcelFormattedTable
                  myInDesign.ExcelImportPreferences.UseTypographersQuotes = True
                  myInDesign.ExcelImportPreferences.ViewName = ""
              End With     

               

              thanks

              • 4. Re: (CS3) Is the "rangeName" property of Application.ExcelImportPreference really broken?
                AdobeScripts Level 3

                "using named ranges in Excel and placing those ranges in InDesign works perfectly"

                in Excel you can select range of cells and set name:

                 

                http://www.contextures.com/xlNames01.html

                 

                robin

                 

                www.adobescripts.co.uk

                • 5. Re: (CS3) Is the "rangeName" property of Application.ExcelImportPreference really broken?
                  ldb68 Level 1

                  Tanks Robert

                   

                  I have seen how create named ranges. I have create a "test" named ranges.

                  I set import preference as   rangeName = "test"

                   

                  With myInDesign.ExcelImportPreferences

                      ...

                      myInDesign.ExcelImportPreferences.rangeName = "test"

                     ...

                  End With          

                   

                  Placing the Excel file inside a frame but all the table and not the

                  "test" named ranges.

                   

                  During the process I place various files (see script if you as time). 

                  May be these interfer with placing excel file?

                   

                  I'm using  Indesing CS3 5.0 on Windows Vista. I want try Indesing CS3

                  6.0 to see if is equal.

                   

                   

                   

                  Robert-Tkaczyk ha scritto:

                  >> "using named ranges in Excel and placing those ranges in InDesign works perfectly"

                  >>    

                  in Excel you can select range of cells and set name:

                   

                  http://www.contextures.com/xlNames01.html

                   

                  robin

                   

                  www.adobescripts.co.uk

                  >