Results 1 to 5 of 5
  1. #1
    3 Star Lounger
    Join Date
    Mar 2006
    Location
    Pittsburgh, Pennsylvania, USA
    Posts
    289
    Thanks
    0
    Thanked 1 Time in 1 Post

    Setting preferences in VBE (2003 sp2)

    The applications I create are often used by those with Access 2000 so I either develop them in that format or convert them afterward. Some of the apps require a table to be exported to a spreadsheet so the reference I have to Microsoft Excel 11.0 Object Library is not valid for 2000 users and I am given no other option. Is there a way then to set the needed reference the first time the app is opened in 2000?

    I saw Charlotte's post 573402 on this but am not sure I understand it.
    Thanks
    chuck

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Setting preferences in VBE (2003 sp2)

    Trying to set references in code in Access is difficult. I'd recommend not to try it. Instead, finalize your database on a PC with Office 2000, i.e. manually set a reference to the Microsoft Excel 10.0 Object Library. The database should then work OK in Office 2000 and in later versions of Office too.

    An alternative would be to use late binding, i.e. not use a reference to Excel. See <post:=526,156>post 526,156</post:> for an explanation.

  3. #3
    3 Star Lounger
    Join Date
    Mar 2006
    Location
    Pittsburgh, Pennsylvania, USA
    Posts
    289
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Setting preferences in VBE (2003 sp2)

    So with the reference to the Excel library removed in the converted copy I added Const acCmdOutputToExcel = 175 under Option Explicit and it worked on my machine. Am I safe to assume it will work under 2000?
    Thanks
    chuck

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Setting preferences in VBE (2003 sp2)

    You don't need to add

    Const acCmdOutputToExcel = 175

    for that is an Access constant, not an Excel constant. You'd need to declare Excel constants such as xlUp or xlWhole if you use them in your code.

  5. #5
    3 Star Lounger
    Join Date
    Mar 2006
    Location
    Pittsburgh, Pennsylvania, USA
    Posts
    289
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Setting preferences in VBE (2003 sp2)

    I think I will follow your first suggestion and set the reference on the PC of the user, or I can bundle the app with runtime. I get a little adventurous sometimes and have to be brought back down to earth. Your patience is greatly appreciated and your help is always the best.
    Thanks
    chuck

Posting Permissions

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