+ Reply to Thread
Results 1 to 7 of 7

Convert 2003 Macro To 2007

Hybrid View

  1. #1
    Registered User
    Join Date
    09-09-2008
    Location
    Turkiye
    Posts
    5

    Question Convert 2003 Macro To 2007

    Sub totals()
    Dim cn As Object, rs As Object
    
    Set cn = CreateObject("ADODB.Connection")
    
    cn.Open _
    "Driver={Microsoft Excel Driver (*.xls)};Dbq=" & _
        ThisWorkbook.FullName
        
    Set rs = cn.Execute( _
    "select distinct isim, sum(başvuru), sum(başarı) " & _
    "from [Sayfa1$] " & _
    "group by isim")
    
    Sheets("zeki").[a2].CopyFromRecordset rs
    
    rs.Close
    cn.Close
    
    Set rs = Nothing
    Set cn = Nothing
    
    Sheets("zeki").Activate
    End Sub
    is it possible to convert this macro to excel2007 .?

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Have you tried in Excel 2007?
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Registered User
    Join Date
    09-09-2008
    Location
    Turkiye
    Posts
    5
    yes, if you save as 2003 format it works, but i have column problem (not enough). i haveto save it as 2007 workbook format.

  4. #4
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,481
    So after you save the workbook as .xlsm format does the code not work?

    We need more detail.
    Cheers
    Andy
    www.andypope.info

  5. #5
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    So you are saying that you need more columns than Excel 2003 provides?

  6. #6
    Registered User
    Join Date
    09-09-2008
    Location
    Turkiye
    Posts
    5
    i cant use it with xlsm format. and i need to convert it to 2007.

    im sorry i need more lines than 2003 provides

  7. #7
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,481


    In order to have code in a 2007 workbook you need to save it with the xlsm format. If you try to save as .xlsx the code will be removed.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Run-time Error 9 with Excel macro - Runs in 2003, Fails in 2007
    By jialant in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-05-2008, 09:37 AM
  2. Running Excel 4.0 Macro in Excel 2007.
    By CdSlc in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-26-2008, 10:46 AM
  3. Macro to add cell below to activecell
    By citygov in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-07-2008, 04:06 PM
  4. Installing Excel 2007 and keeping Excel 2003
    By secmaster420 in forum Excel General
    Replies: 4
    Last Post: 11-08-2007, 04:09 PM
  5. Excel 2003 XLODBC addin convert to ADO
    By mdrum in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-02-2007, 06:20 AM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1