Results 1 to 6 of 6

Thread: Acad & Excel

  1. #1
    AUGI Addict MikeJarosz's Avatar
    Join Date
    2003-09
    Location
    New York NY
    Posts
    1,018

    Default Acad & Excel

    I have been harvesting data from Acad drawings and dumping it into Excel for years now. Just when you think you've mastered the technique, something new comes up.

    I have two versions of Excel installed, 2003 and 2007. The firm at large uses 2003. I have 2007 for evaluation and testing and I am developing an Acad VBA application that exports to Excel. I will need to distribute the application in 2003. My problem is, when I start Excel from VBA, I get 2007, not the 2003 I want.


    Code:
     
    Dim XL As Excel.Application
    Set XL = CreateObject("Excel.Application")
    Any ideas how I can force 2003 to start?
    "everything you know is wrong...." -FST

  2. #2
    Member
    Join Date
    2006-02
    Posts
    20

    Default Re: Acad & Excel

    Code:
    Set XL = CreateObject("Excel.Application.11")
    ska

  3. #3
    Certified AUGI Addict rkmcswain's Avatar
    Join Date
    2004-09
    Location
    Houston
    Posts
    7,543

    Default Re: Acad & Excel


  4. #4
    AUGI Addict MikeJarosz's Avatar
    Join Date
    2003-09
    Location
    New York NY
    Posts
    1,018

    Default Re: Acad & Excel

    Quote Originally Posted by saustin View Post
    Code:
    Set XL = CreateObject("Excel.Application.11")
    ska
    I see where the 11 & 12 comes from:

    c:/Program Files/Microsoft Office/OFFICE11/EXCEL.EXE
    c:/Program Files/Microsoft Office/Office12/EXCEL.EXE

    Excel.Application.12 brings up 2007. Unfortunately, Excel.Application.11 brings up 2007 too! Maybe the registry has been altered to point to 2007?
    "everything you know is wrong...." -FST

  5. #5
    Member
    Join Date
    2002-01
    Posts
    6

    Default Re: Acad & Excel

    Exactly right- my understanding is the registry accepts the last program installed as the default for any "type" of file (like .xls).

  6. #6
    Forum Manager, Administrator Ed Jobe's Avatar
    Join Date
    2000-11
    Location
    Turlock, CA
    Posts
    4,791

    Default Re: Acad & Excel

    Quote Originally Posted by steve.patten View Post
    Exactly right- my understanding is the registry accepts the last program installed as the default for any "type" of file (like .xls).
    The registry is a little more complicated than that. The part of the registry being dealt with here is the HKEY_CLASSES section. When you use the CreateObect or GetObject functions, the argument requires a class string. Without the number suffix, its version generic, that is the latest version is used. If you require a specific version, then you need to specify the fully qualified class name.

    The program that gets launched for a certain file type is controlled in a different area of the registry. The gui for that is in Explorer>Tools>OptionsFile Types.
    C:> ED WORKING....

Similar Threads

  1. Excel 2007 with acad 2010
    By clovis in forum AutoLISP
    Replies: 13
    Last Post: 2012-01-23, 10:47 AM
  2. Access Excel from ACAD
    By csorensen in forum CAD Management - General
    Replies: 23
    Last Post: 2010-02-12, 06:22 PM
  3. How run Excel macro from ACAD
    By tsaracho in forum VBA/COM Interop
    Replies: 3
    Last Post: 2010-02-01, 02:19 PM
  4. Running Excel from ACAD
    By MikeJarosz in forum VBA/COM Interop
    Replies: 3
    Last Post: 2006-07-14, 05:14 PM
  5. printing acad with excel in the dwg
    By RCA4697 in forum AutoCAD General
    Replies: 2
    Last Post: 2005-03-23, 04:50 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •