Create rectangles of information in the excel file... Help!

I need help and have NO idea of what I'm doing. I have an excel file with thousands of lines, each with a column for the coordinate x, y-suface, the height and width of a rectangle. I need a script that will ask me to select the excel file, read the excel file and create rectangles of each of thousands of lines. I guess it would be simple enough for someone who knows what they're doing, but I have no idea where to start. I work in a windows environment and I have Illustrator CS4. Any suggestions? All scripts out there that could give me a start?

you go, it's VBA code, I prefer to use it when I need to have Excel speak to Illustrator directly without exporting the data in Excel.

to set up...

-Open Excel

-Press on Alt + F11 to bring up the editor

-in the Tools menu, click references.

-Add a reference to 'Adobe Illustrator CS5 type library' (or CS4 or your version)

-in the perso.xls (or any other book) to add a Module. Personal is a comprehensive workbook that is always available. If you don't see it, go back to Excel and save a macro, anything will do. Who will create the personal folder.

-type the following in this module

Sub makeSquares()
    'carlos canto // 6/26/13
    'reads the active Excel workbook data to create squares in Illustrator
    'data is organized in rows as follows x, y, width, height
    'data has no headers, first row in cell "A1"

    Dim iapp As New Illustrator.Application
    Dim idoc As Illustrator.Document
    Dim isquare As Illustrator.PathItem

    Dim rowcount As Integer
    Dim x As Double
    Dim y As Double
    Dim w As Double
    Dim h As Double

    rowcount = Cells(1, 1).CurrentRegion.Rows.Count

    Set idoc = iapp.Documents.Add

    For i = 1 To rowcount
        x = Cells(i, 1)
        y = Cells(i, 2)
        w = Cells(i, 3)
        h = Cells(i, 4)

        Set isquare = idoc.PathItems.Rectangle(y, x, w, h)
    Next

    Set isquare = Nothing
    Set idoc = Nothing
    Set iapp = Nothing
End Sub

-Save the personal book

-to run, move the cursor anywhere inside the slot... End Sub and press F5

For simplicity, launch illustrator before running the script

Tags: Illustrator

Similar Questions

  • Report and read the Excel file

    Hi all

    I need to match the styles of paragraphs with Indesign and files the Excel file.

    Excel file consists of (approximately 500 paragraph Styles) naming of the files of standard paragraph styles

    Files InDesign with 100 paragraph Styles.

    My request:

    I need to generate the report if Indesign paragraph styles that are not in the Excel file.

    for example,.

    Indesign file Excel file

    h1                             H1

    h2                              h2

    h3                              BL

    tx                              tx1

    TX1

    TX2

    Create the report as:

    Paragraph error style is H1 and BL in Indesign file

    Created script:

    var myDoc = app.activeDocument;
    
    var myPstyles = app.activeDocument.allParagraphStyles;
    
    alert("myPstyles: " + myPstyles.length)
    
    for(i=0; i<myPstyles.length; i++)
    {
         var IndesignPStyles = myPstyles[i].name;
        alert(myPstyles[i].name)
        }
    //_____________________________________________________________
    
    //Help Here
    
    var myFile = File.openDialog("Choose a tab delimitted txt file:");
    if (!myFile){
    exit();
    }     
     
    myFile.open('r');
    while (myFile.eof==false){
         line=myFile.readln();
         line = line.split("\t");
         myFind = line[0];
    }
    
    
    

    Could someone help with this request.

    Thanks in advance

    Beginner_X

    Hi BEGINNER_X,

    First of all, you must convert the excel file to the format of files "*.csv or delimited by tabs. (I use commas .csv file).

    You posted in above code JS reading only the names of paragraph style. Then another code is read only comma-delimited text file, but you are not comparing the paragraph style in the list of excel files. You missed here.

    Please try the JS code below his works very well, but not generated the report file. I hope that you will generate the report of your side file.

    var myFile = File.openDialog("Choose a tab delimitted txt file:");
    if (!myFile){
    exit();
    }     
    
    var myArray = []
    myFile.open('r');
    while (myFile.eof==false){
        var line=myFile.readln().split(",");
        myArray.push(line[0]);
        }
    
    var myDoc = app.activeDocument;
    var myPstyles = app.activeDocument.allParagraphStyles;
    
    Array.prototype.contains = function(obj) {
        var i = this.length;
        while (i--) {
            if (this[i] === obj) {
                return true;
            }
        }
        return false;
    }
    
    var myMissingStyle =[];
    for(i=2; i
    

    THX,

    csm_phil

  • InDesign script to put the excel file

    Hi all, I'm new to Indesign Scripting, and I hope someone can help me with the following code:

    All I want to do is:

    1. Open the indesign file
    2. Open excel file
    3. ExcelFile place as a table (with active flow)
    4. export as PDF & save document

    Thank you!

    //Define file to open
    var myDocumentFile = new File("/d/Projecten/Indesign Server/document.indd");
    //Define file to save
    //var mySaveFile = new File("/d/Projecten/Indesign Server/document_save.indd");
    //Define file to export
    var exportPDF = new File("/d/Projecten/Indesign Server/document_save.pdf");
    //Open xls-file to place as table
    var myExcelFile = new File ("/d/Projecten/Indesign Server/products.xls");
    
    var result = "";
    if(!myDocumentFile.exists) {
        result = "Unable to find DOCUMENT:  " + myDocumentFile.path;
        $.writeln(result);
        exit();
    } else if(!myExcelFile.exists) {
        result = "Unable to find EXCEL:  " + myDocumentFile.path;
        $.writeln(result);
        exit();
    } else {
        // Open file
        var myDocument = app.open(myDocumentFile);
        with(app.documents.item(0).pages.item(0)){
            myTarget = textFrames.item("tabel");
        }
        var myPage = myDocument.pages.item(0);
    
        //Set excel placement properties
        setXLimportPrefs();
    
        // Place Excel file
           try {
                 $.writeln("Place Excel file");
                //HELP!! HOW TO PLACE EXCEL FILE?
                //myTextFrame.place(myFile);
            }
            catch (e) {
                 $.writeln("Place Excel file "  + e + " " + app.excelImportPreferences.errorCode);
                myDocument.close();
                exit();
            } 
        if(!exportPDF.parent.exists && !exportPDF.parent.create()) {
            result = "Not exported.  Unable to create the folder:  " + exportPDF.parent.fullName;
            $.writeln(result);
        } else {
            app.documents.item(0).exportFile(ExportFormat.pdfType, exportPDF, app.pdfExportPresets.item("[Press Quality]"));
        }
        myDocument.exportFile(ExportFormat.PDF_TYPE,exportPDF);
        myDocument.close();
    }
    
    function setXLimportPrefs(){    $.writeln("setXLimportPrefs()");
            with(app.excelImportPreferences){
                //alignmentStyle property can be:
                //AlignmentStyleOptions.centerAlign
                //AlignmentStyleOptions.leftAlign
                //AlignmentStyleOptions.rightAlign
                //AlignmentStyleOptions.spreadsheet
                alignmentStyle = AlignmentStyleOptions.spreadsheet;
                decimalPlaces = 4;
                preserveGraphics = true;
                //Enter the range you want to import as "start cell:end cell".
                rangeName = "A1:B16";
                sheetIndex = 1;
                sheetName = "Appetizers";
                showHiddenCells = false;
                //tableFormatting property can be:
                //TableFormattingOptions.excelFormattedTable
                //TableFormattingOptions.excelUnformattedTabbedText
                //TableFormattingOptions.excelUnformattedTable
                tableFormatting = TableFormattingOptions.excelFormattedTable;
                useTypographersQuotes = true;
                viewName = "";
            }
    }
    result;
    
    

    myTextFrame is not defined in your script.

    It works for me:

    myTextFrame = app.selection[0];
    var myExcelFile = new File ("~/Documents/idml/some file.xlsx");
    myTextFrame.place (myExcelFile);
    

    -When I select a text block, of course.

    To debug this, you can remove the try... catch statements because they're actually hiding the error now: InDesign can place the file, but the variable does not exist.

    Thankfully, I fell it many times before.

  • Download and open the Excel files on iPad Pro

    I have the new iPad Pro.  I have Office 365 is installed.  In my work, I run queries of data on a server and the query result comes to me in Excel.  I want to download the Excel file and open it for editing on my iPad Pro.  What I have actually / to accomplish this task?

    You should be able to do this by using numbers

    https://www.Apple.com/ca/support/iWork-for-icloud/numbers/

  • labView send data wireless node for the excel file

    Hi all

    I used the basic tutorial for the network of wireless sensors OR. http://www.ni.com/tutorial/8890/en/. I finished it with a single node. The next phase of my project is to send the data from the node and the date and time in an excel file every hour. Is there any advice I can get to at least send the date and the data in the excel file? I'm using labView in 2012

    I change, because I put the text instead of excel file

    You cannot connect a scalar to the entry level that is needed. A solution would be to insert a table to build before the writing on the worksheet.

  • Entries are concatenated in the same column in the excel file

    Hi, I really need help in this emergency. The problem is when I open the spreadsheet file after you run the program below, all the values that I believe are concatenated in the same column. However, there are 2 different analog inputs which I want in 2 different columns. I'm getting the 2 waveforms in the same graph, but when I open the excel file, it seems that the entries are concatenated in the same column. Someone knows how to fix this? Thank you very much.

    Hi Ben 64,.

    Thanks a lot again. I did as you said and I removed the dynamic data and logged files added directly to the results. I'm still checking if the program works as I can branch only when I return to work tomorrow. Tell me if you think it might be able to work this time. Thanks a lot again!

  • It is an intermittent problem, as the excellent files, powerpoint will corrupt network drive.

    It is an intermittent problem, as the excellent files, powerpoint will corrupt network drive. Any help will be much appreciated.

    To avoid this, I'm making sure that files are not left open so much because we run backup incremental three times in a week.

    Files is not very high - about - 2 MB

    Some screenshots are inserted

    Thank you

    Amit

    http://answers.Microsoft.com/en-us/Office/Forum/office_xp-Excel?tab=unanswered&TM=1373425932359

    above is office xp, excel forum you might be better off poster in this forum that many people are familiar with excel and powerpoint.

  • I have a form with the field names are the same as my excel sheet spread, how can I do the pdf file to find the excel file?

    Is it possible to link them together for the PDF will automatically fill in the excel file? Also is there a way to fill in a field in the PDF with a combination of two fields in the excel file. Example pdf 'name' a 'name' and 'name' excel file, I want to fill in the name of the PDF with a combination of the first name and name of the excel file.

    Thanks for any help.

    Using the example above, the custom in the 'name' field calculation code will be:

    This.getField("first_name").value = Event.Value + "" + this.getField("last_name").value;

  • How to extract information from the ovf file from a file of eggs by programming?

    How to extract information from the ovf file from a file of eggs by programming?

    Hello

    Please provide details:

    -On what OS you are programming (Linux, Windows,...)?

    -What programming or scripting language do you use?

    An EGG file is just a tarball of hard, .ovf and .mf files. The .ovf file is always the first. For example, on a Unix like operating system, this should be easy.

    For Windows, there are several options available to manage programmatically the tarballs. See for example http://www.codeproject.com/Articles/470999/tarlib-Windows-TAR-Library.

    And the ovf itself file is in XML format. For handling XML files are libraries available for literally every OS and programming language.

    Google is your friend.

    Andreas

  • How can I disable the USE of INFORMATION in the .msi file?

    How can I disable the USE of INFORMATION in the .msi file? I used the wizard to activate online services, but after I installed is not there in the preferences. It reappears in some way after that I have run CD a few times, returns the INFORMATION of USE. Someone knows how to remove it in the wizard so that it doesn't make the use of Adobe? I want that this feature be turned off at installation time and not have to change this setting after installation.

    Hi Stephanie,

    Your question has already been followed in this thread How to disable the USE of INFORMATION in the file .msi - DRIVE DC. Please refer to the same thing.

    Kind regards

    Nicos

  • Output in the Excel file

    Hello

    How can I get a query result in the EXCEL file? I use Oracle11g in soundcards XP.

    Thank you.
    Asif

    Published by: asif.maqbool on April 16, 2013 02:17

    SQL > the value html markup on
    SQL > set off comments
    SQL > spool c:\.xls
    SQL > select * from XXXXXX where XXXXXX;
    SQL > spool off
    SQL > set markup html off

  • Search and replace the contents of the excel file

    Hello

    I have the list in the excel file that needs to replace. The script should read the excel then replace to open InDesign documents.

    The excel (*.xls) file has two columns, the first column has our old. and the second column has the new numbers to replace.

    Ex:

    Column 1 column 2

    (Research)               (Replace)

    -----------------------------------

    4257/2 = > 1/2

    4257/3 = > 1/3

    4257/4 = > 1/4

    ....

    3257/2 = > 1/5

    3257/3 = > 1/6

    3257/4 = > 1/7

    ....

    4457/4 = > 2/2

    4457/5 = > 2/3

    4457/6 = > 2/4

    4457/7 = > 2/5

    ......

    Thanks in advance,

    Thiru

    Hi Poirier,

    I modified your request for entry of csv file.

    Please save it as the xls to text delimetted tab. See the snapshot below.

    Then, run the provided scripts it will change the values.

    var myFile = File.openDialog("Choose a tab delimitted txt file:");
    if (!myFile){
    exit();
    }     
    
    myFile.open('r');
    while (myFile.eof==false){
         line=myFile.readln();
         line = line.split("\t");
         myFind = line[0];
         myChange = line[1];
         app.findGrepPreferences = app.changeGrepPreferences = NothingEnum.nothing;
         app.findGrepPreferences.findWhat = myFind;
         app.changeGrepPreferences.changeTo=myChange;
         app.documents.item(0).changeGrep();
         app.findGrepPreferences = app.changeGrepPreferences = NothingEnum.nothing;
         }
    myFile.close();
    

    THX

    csm_phil

  • Getting information about the FLV file...

    is it possible to get information from the FLV file (perhaps in the metadata) to find the codec, frame rate, kilobits per second, audio data rate, etc...

    can read the information? or can it be done IN flash?

    FLV metadata viewer:

    http://www.buraks.com/flvmdv/

  • can export us all the data in the Excel file format table in oracle?

    Hello

    Is it possible to export all the data in the table to the excel file format?

    Thank you

    Hi Mohammed_82!

    Oracle itself has no tools to export in csv or excel format. You have to search third-party tools such as Toad or the Torah.

    concerning

  • I'm trying to import the excel file e-mail addresses in thunderbird. Having created the file csv and lined up fileds in thunderbird, but no information is

    I have an excel database and want to use some of the information provided for thunderbird email addresses inside. I cut out infomration excel database I don't need and saved as csv. In thunderbird, I try to import the csv file - I align the name of data, surname etc. and import - thunderbird said 180 addresses imported, but no information appears on the screen. Any help much appreciated. Thank you Tim

    They appear if you close and re-open the address book? The full name of the csv field is empty?

    https://getsatisfaction.com/mozilla_messaging/topics/importing_windows_live_contacts#reply_8555932

Maybe you are looking for