Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 179
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
"Document Not Saved" Saving File Created from Template PLEASEHELP!!!! Pamela[_3_] Excel Discussion (Misc queries) 1 February 5th 09 07:42 AM
Whats the new "Template Wizard with Data Tracking"? Will Excel Worksheet Functions 4 February 7th 07 09:35 AM
What does "cannot open up template wizard" mean? trainer07 Excel Discussion (Misc queries) 0 January 5th 07 10:40 PM
Error"cannot open template wizard" in excel2003 is appearing ? Balram Anand Excel Discussion (Misc queries) 2 July 14th 06 04:23 PM
Updating database worksheet problem (Template Wizard) grasping@straws Excel Discussion (Misc queries) 1 December 17th 04 02:26 PM


All times are GMT +1. The time now is 02:43 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"