Results 1 to 4 of 4
  1. #1
    2 Star Lounger
    Join Date
    Apr 2001
    Location
    Vancouver, Canada
    Posts
    131
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Macros in an *.xlt file (Excel 2000 SR1)

    I have created an xlt file that will add a new record to a database. I would like the whole process to be "hidden" in a macro. I have placed a button on the spreadsheet that will pull up the form...now I want a button on the form itself that will save the new record into the database without showing the built in Excel dialog box that asks whether they want to create a new record (I want it to default to always create a new record) and I also want to avoid showing the "Save As" dialog box that appears. Is there any way to do this?

    Is there anyplace where I can see the code from the built in Excel features (such as the one the shows the dialog asking whether or not to create the new record?

    Thanks in advance for your help.

    Christa

  2. #2
    Uranium Lounger
    Join Date
    Jan 2001
    Location
    South Carolina, USA
    Posts
    7,295
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Macros in an *.xlt file (Excel 2000 SR1)

    If you use the workbook.SaveAs method in a macro, it should not show the dialog box. If you also don't want the messages that you get if the file already exists, then you can also set the DisplayAlerts property, something like this:

    <pre> Application.DisplayAlerts = False
    CurrentWorkbook.SaveAs "C:MyDirMyWorkbook.xls"
    Application.DisplayAlerts = True
    </pre>


    I don't know what database you are using, or how you are creating the record, but it should be possible to do that also without any dialog boxes or messages.
    Legare Coleman

  3. #3
    2 Star Lounger
    Join Date
    Apr 2001
    Location
    Vancouver, Canada
    Posts
    131
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Macros in an *.xlt file (Excel 2000 SR1)

    I am using an Excel database and the template "wizard" creates the record...it's a built in Excel thing when you use the Template Wizard to create at template. Is there anywhere I can look for the code for built in Excel features/add-ins?

    Thanks,

    Christa

  4. #4
    Uranium Lounger
    Join Date
    Jan 2001
    Location
    South Carolina, USA
    Posts
    7,295
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Macros in an *.xlt file (Excel 2000 SR1)

    The Help file for most features/addins has a button at the top labeled Example that will show some code using that feature. The code does not always show what you want to do with the feature, and sometimes does not work, but it is a start.
    Legare Coleman

Posting Permissions

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