Results 1 to 3 of 3
  1. #1
    3 Star Lounger
    Join Date
    Jan 2001
    Posts
    294
    Thanks
    0
    Thanked 0 Times in 0 Posts

    ? on an error (Access 97)

    Below is part of module from a db I took over for someone who left are company. The db was running fine but for some reason now we receive an error when this is run. The error is Compile Error: User-Defined type not defined. It yellows out this line. Dim xlApp As Excel.Application
    This line is used to open excel.
    Is there something wrong with this code? I'm clueless. Thanks for the help...

    Dim filetoopen As String
    Dim varExcelName As String
    varExcelName = saveme & ".XLS"
    filetoopen = xlApp.GetSaveAsFilename(varExcelName, "Microsoft Excel Files (*.xl*), *.xls

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

    Re: ? on an error (Access 97)

    Probably the reference to the Excel object library got lost.

    Open any module in design view. Select Tools/References...
    If there is any reference with MISSING, uncheck it, click OK and select Tools/References... again.
    If Microsoft Excel 8.0 Object Library is checked, uncheck it, click OK and select Tools/References... again.
    Locate Microsoft Excel 8.0 Object Library in the list and check the box to the left of it. Click OK.
    Now try to compile the code (from the Debug menu).

    If this doesn't help, post back.

  3. #3
    3 Star Lounger
    Join Date
    Jan 2001
    Posts
    294
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: ? on an error (Access 97)

    Thanks Hans. That was the problem..

Posting Permissions

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