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

    Home » Forums » AskWoody support » Productivity software by function » MS Excel and spreadsheet help » Macros in an *.xlt file (Excel 2000 SR1)

    Author
    Topic
    #365202

    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

    Viewing 0 reply threads
    Author
    Replies
    • #562955

      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:

          Application.DisplayAlerts = False
          CurrentWorkbook.SaveAs "C:MyDirMyWorkbook.xls"
          Application.DisplayAlerts = True
      

      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.

      • #562956

        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

        • #562960

          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.

    Viewing 0 reply threads
    Reply To: Macros in an *.xlt file (Excel 2000 SR1)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: