+ Reply to Thread
Results 1 to 11 of 11

Using VBA written created with excel 2013 in excel 2007

  1. #1
    Registered User
    Join Date
    09-27-2007
    Location
    Staten Island, NY
    MS-Off Ver
    Office 2013
    Posts
    64

    Using VBA written created with excel 2013 in excel 2007

    Ok, I have looked this up but don't quite know what to do. As the title says, I created my workbook tracking program in 2013.
    Others at work use 2007 and I get some errors, like with Application.PrintCommunication for example.

    I know I have to Bind some references, but how do I go about that and what do I bind?

  2. #2
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,197

    Re: Using VBA written created with excel 2013 in excel 2007

    Hi, Aris,

    maybe post the code which is causing the run-time error to have a look at.

    Ciao,
    Holger
    Use Code-Tags for showing your code: [code] Your Code here [/code]
    Please mark your question Solved if there has been offered a solution that works fine for you

  3. #3
    Registered User
    Join Date
    09-27-2007
    Location
    Staten Island, NY
    MS-Off Ver
    Office 2013
    Posts
    64

    Re: Using VBA written created with excel 2013 in excel 2007

    Quote Originally Posted by HaHoBe View Post
    Hi, Aris,

    maybe post the code which is causing the run-time error to have a look at.

    Ciao,
    Holger
    Ok, I'll post it when I get home later. It all works perfect
    In 2013, it just errors out in 2007. I put so much work into
    These workbooks , to come to a halt because of a version,
    Would drive me insane! Lol

  4. #4
    Registered User
    Join Date
    09-27-2007
    Location
    Staten Island, NY
    MS-Off Ver
    Office 2013
    Posts
    64

    Re: Using VBA written created with excel 2013 in excel 2007

    Here is the line that throws the error:

    Please Login or Register  to view this content.
    Is this not available in 2007? How do I bind the new references to my file?

  5. #5
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,197

    Re: Using VBA written created with excel 2013 in excel 2007

    Hi, Aris,

    have you tried commenting the code lines
    Please Login or Register  to view this content.
    and
    Please Login or Register  to view this content.
    Ciao,
    Holger

  6. #6
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Using VBA written created with excel 2013 in excel 2007

    Quote Originally Posted by Aris View Post
    Here is the line that throws the error:

    Please Login or Register  to view this content.
    Is this not available in 2007? How do I bind the new references to my file?
    No - it was only introduced in 2010. Just remove it as Holger said - you can't add references to get round it.
    Remember what the dormouse said
    Feed your head

  7. #7
    Registered User
    Join Date
    09-27-2007
    Location
    Staten Island, NY
    MS-Off Ver
    Office 2013
    Posts
    64

    Re: Using VBA written created with excel 2013 in excel 2007

    Ok. Is there a code line that I can check what someone version of excel is?

    Then I'll just fix it so if they have an old version it skips that section of code.

  8. #8
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Using VBA written created with excel 2013 in excel 2007

    To the best of my recollection, 2007 was still VBA6 so you could use:
    Please Login or Register  to view this content.

  9. #9
    Registered User
    Join Date
    09-27-2007
    Location
    Staten Island, NY
    MS-Off Ver
    Office 2013
    Posts
    64

    Re: Using VBA written created with excel 2013 in excel 2007

    Ok I'll give that a shot. Btw, what are the # for?

  10. #10
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Using VBA written created with excel 2013 in excel 2007

    It's conditional compilation so the compiler will ignore the code completely unless the VBA7 constant has a value 1. Otherwise you would have to have separate modules for all the code that is specific to any particular version.

  11. #11
    Registered User
    Join Date
    09-27-2007
    Location
    Staten Island, NY
    MS-Off Ver
    Office 2013
    Posts
    64

    Re: Using VBA written created with excel 2013 in excel 2007

    Ok, I just commented those pages out and it is fine. Nice easy fixes are always the best!

    Thanks all!

+ 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. Excel 2013 won't run a macro attached to button created in excel 2003
    By Jonno1 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 04-30-2020, 01:16 AM
  2. Macros written in Excel 2010 don't work in Excel 2013
    By Bukovnik in forum Excel Programming / VBA / Macros
    Replies: 19
    Last Post: 09-03-2015, 01:24 AM
  3. [SOLVED] Created XLSM in Excel 2013, Customer Makes Change in Excel 2010 -> VBA,Formatting Errors
    By JPFold in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-13-2014, 09:51 AM
  4. Code created in Excel 2010 does not work with Excel 2013
    By Steve@Rugby in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-28-2014, 10:14 AM
  5. script written in excel 2003 not working for excel 2007 and above
    By justinng in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-29-2011, 06:46 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