PC Review


Reply
Thread Tools Rate Thread

Remove prompt for replacing file

 
 
Song Su
Guest
Posts: n/a
 
      27th Jun 2009

Access 2007 SP2

My macro action 'OutPutTo' has following arguments:

Object Type: Report
Object Name: rptAutoSubjSU
Output Format: PDF Format (*.pdf)
Output File: Summer by Course.pdf

I want to put this macro on Windows schedule task to run unattended.
How to suppress prompt: "The file already exist. Do you want to replace?" on
each run?

Thanks

 
Reply With Quote
 
 
 
 
Steve Schapel
Guest
Posts: n/a
 
      27th Jun 2009

Song Su,

There may be a way to do this in a macro, but if so I can't find it.

The only way I know is to use VBA procedure instead of macro. That way, you
can test the existence (use Len(Dir(Path&File))) of the file already, and if
it exists, delete it (use Kill method) before OutputTo.

Only other thing you can do is uniquely name the file each time you output,
for example by adding date stamp to the file name.

--
Steve Schapel, Microsoft Access MVP


"Song Su" <(E-Mail Removed)> wrote in message
news:4BC04C10-AF6F-4F06-B38E-(E-Mail Removed)...
> Access 2007 SP2
>
> My macro action 'OutPutTo' has following arguments:
>
> Object Type: Report
> Object Name: rptAutoSubjSU
> Output Format: PDF Format (*.pdf)
> Output File: Summer by Course.pdf
>
> I want to put this macro on Windows schedule task to run unattended.
> How to suppress prompt: "The file already exist. Do you want to replace?"
> on each run?
>




__________ Information from ESET Smart Security, version of virus signature database 4193 (20090626) __________

The message was checked by ESET Smart Security.

http://www.eset.com



 
Reply With Quote
 
 
 
 
Song Su
Guest
Posts: n/a
 
      27th Jun 2009

Steve Schapel,

I maybe able to figure out using VBA to create pdf and overwrite existing
file. Even if I can, how to use macro to run that VBA? Because I want to use
Windows Scheduler to run unattended and only macro can do this.

Song

"Steve Schapel" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Song Su,
>
> There may be a way to do this in a macro, but if so I can't find it.
>
> The only way I know is to use VBA procedure instead of macro. That way,
> you can test the existence (use Len(Dir(Path&File))) of the file already,
> and if it exists, delete it (use Kill method) before OutputTo.
>
> Only other thing you can do is uniquely name the file each time you
> output, for example by adding date stamp to the file name.
>
> --
> Steve Schapel, Microsoft Access MVP
>
>
> "Song Su" <(E-Mail Removed)> wrote in message
> news:4BC04C10-AF6F-4F06-B38E-(E-Mail Removed)...
>> Access 2007 SP2
>>
>> My macro action 'OutPutTo' has following arguments:
>>
>> Object Type: Report
>> Object Name: rptAutoSubjSU
>> Output Format: PDF Format (*.pdf)
>> Output File: Summer by Course.pdf
>>
>> I want to put this macro on Windows schedule task to run unattended.
>> How to suppress prompt: "The file already exist. Do you want to replace?"
>> on each run?
>>

>
>
>
> __________ Information from ESET Smart Security, version of virus
> signature database 4193 (20090626) __________
>
> The message was checked by ESET Smart Security.
>
> http://www.eset.com
>
>
>

 
Reply With Quote
 
Steve Schapel
Guest
Posts: n/a
 
      28th Jun 2009

Song,

Make the VBA code as a function in a standard module. Then you can use a
macro with a RunCode action to call the function.

--
Steve Schapel, Microsoft Access MVP


"Song Su" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Steve Schapel,
>
> I maybe able to figure out using VBA to create pdf and overwrite existing
> file. Even if I can, how to use macro to run that VBA? Because I want to
> use
> Windows Scheduler to run unattended and only macro can do this.
>
> Song




__________ Information from ESET Smart Security, version of virus signature database 4193 (20090626) __________

The message was checked by ESET Smart Security.

http://www.eset.com



 
Reply With Quote
 
Song Su
Guest
Posts: n/a
 
      28th Jun 2009

Steve,

It works great! Thanks a lot.

Song

"Steve Schapel" <(E-Mail Removed)> wrote in message
news:#(E-Mail Removed)...
> Song,
>
> Make the VBA code as a function in a standard module. Then you can use a
> macro with a RunCode action to call the function.
>
> --
> Steve Schapel, Microsoft Access MVP
>
>
> "Song Su" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> Steve Schapel,
>>
>> I maybe able to figure out using VBA to create pdf and overwrite existing
>> file. Even if I can, how to use macro to run that VBA? Because I want to
>> use
>> Windows Scheduler to run unattended and only macro can do this.
>>
>> Song

>
>
>
> __________ Information from ESET Smart Security, version of virus
> signature database 4193 (20090626) __________
>
> The message was checked by ESET Smart Security.
>
> http://www.eset.com
>
>
>

 
Reply With Quote
 
Steve Schapel
Guest
Posts: n/a
 
      28th Jun 2009

Very good, Song. Thanks for letting us know!

--
Steve Schapel, Microsoft Access MVP


"Song Su" <(E-Mail Removed)> wrote in message
news:E2562FF0-A7ED-4D70-A820-(E-Mail Removed)...
> Steve,
>
> It works great! Thanks a lot.
>




__________ Information from ESET Smart Security, version of virus signature database 4193 (20090626) __________

The message was checked by ESET Smart Security.

http://www.eset.com



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Replacing text, instead of replacing, text inserts alongside word =?Utf-8?B?TWFyZ2FyZXQgTWlua2Vy?= Microsoft Word Document Management 4 9th Dec 2005 04:52 PM
replacing dll file to remove a virus dogger@yahoo.com Anti-Virus 5 30th Nov 2005 05:00 PM
Regular expressions: Replacing whole words without replacing non word chararcters leeonions Microsoft VB .NET 2 29th Sep 2005 03:33 PM
Regular expressions: Replacing whole words without replacing non word chararcters leeonions Microsoft VB .NET 0 28th Sep 2005 01:20 PM
Query skips input for Where clause if second table or query added or if prompt contains blanks in the prompt string =?Utf-8?B?SHVudGVy?= Microsoft Access Queries 0 18th Mar 2004 11:01 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:35 PM.