Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Template Wizard - "Saving to Database" Problem
Hi everyone,
Using the "Template wizard" add-in, I've created an XLT file with the ms Access database on the back-end. This works well and I was able to enter data in the template and save it as both "XLS" file and a record in the MS Access database. However, when writing a code to autmatically save the data in the same manner, the program just saved XLS file but didn't even prompt for "saving to database" options. As a result there's no record created in the MS Access database:) Here's my code... ActiveWorkbook.SaveAs Filename:="C:\Test.xls", _ FileFormat:=xlNormal, Password:="", WriteResPassword:="", ReadOnlyRecommended:=False, _ CreateBackup:=False Anyone has any idea what's wrong with this and how to fix this problem? Any help is much appreciated. Thanks in advance, Pam |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Template Wizard - "Saving to Database" Problem
Pam
After your SaveAs line, put this line Application.Run "Commit" That will bring up the dialog that asks whether to save a new record. -- Dick Kusleika MVP - Excel www.dicks-clicks.com Post all replies to the newsgroup. "pam asar" wrote in message ... Hi everyone, Using the "Template wizard" add-in, I've created an XLT file with the ms Access database on the back-end. This works well and I was able to enter data in the template and save it as both "XLS" file and a record in the MS Access database. However, when writing a code to autmatically save the data in the same manner, the program just saved XLS file but didn't even prompt for "saving to database" options. As a result there's no record created in the MS Access database:) Here's my code... ActiveWorkbook.SaveAs Filename:="C:\Test.xls", _ FileFormat:=xlNormal, Password:="", WriteResPassword:="", ReadOnlyRecommended:=False, _ CreateBackup:=False Anyone has any idea what's wrong with this and how to fix this problem? Any help is much appreciated. Thanks in advance, Pam |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Template Wizard - "Saving to Database" Problem
I just tried what Dick suggested and it works
magically...I wonder what's the "commit", a built-in macro? Thx much, Pam -----Original Message----- Pam After your SaveAs line, put this line Application.Run "Commit" That will bring up the dialog that asks whether to save a new record. -- Dick Kusleika MVP - Excel www.dicks-clicks.com Post all replies to the newsgroup. "pam asar" wrote in message ... Hi everyone, Using the "Template wizard" add-in, I've created an XLT file with the ms Access database on the back-end. This works well and I was able to enter data in the template and save it as both "XLS" file and a record in the MS Access database. However, when writing a code to autmatically save the data in the same manner, the program just saved XLS file but didn't even prompt for "saving to database" options. As a result there's no record created in the MS Access database:) Here's my code... ActiveWorkbook.SaveAs Filename:="C:\Test.xls", _ FileFormat:=xlNormal, Password:="", WriteResPassword:="", ReadOnlyRecommended:=False, _ CreateBackup:=False Anyone has any idea what's wrong with this and how to fix this problem? Any help is much appreciated. Thanks in advance, Pam . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
"Document Not Saved" Saving File Created from Template PLEASEHELP!!!! | Excel Discussion (Misc queries) | |||
Whats the new "Template Wizard with Data Tracking"? | Excel Worksheet Functions | |||
What does "cannot open up template wizard" mean? | Excel Discussion (Misc queries) | |||
Error"cannot open template wizard" in excel2003 is appearing ? | Excel Discussion (Misc queries) | |||
Updating database worksheet problem (Template Wizard) | Excel Discussion (Misc queries) |