Re: Overwriting a file in VB

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Crash wrote:
>>> I'm creating a macro that saves some files each week. I wanted to
>>> save the files over top of the files from last week. Each time I
>>> run the macro it asks me to overwrite the files and I would like it
>>> to just do it without asking.
>>
>> Sounds like you're using VBA within an Office app? What/where?
>>
>> True VB file i/o never prompts you for anything.
>
> Yeah, I'm actually using VB script inside an Excel document.

VBA, actually. VBS is another beast entirely. (These are *not* petty
distinctions, either.)

In Excel, you can set the Application.DisplayAlerts property to False, do
the dirty deed, then set it back to True.
--
Be the 10,000th Signer!
http://classicvb.org


.



Relevant Pages

  • Re: Save - Yes / No / Cancel
    ... I have found some vba that may " Force users to enable ... hidden except one that says about your macro status. ... other sheets are visable using the very-visable routine. ... status page but because its done that again says "overwrite existing ...
    (microsoft.public.excel.misc)
  • Re: Passing Macros Between Workbooks
    ... The easiest way is to have the macro in its own module, ... this (which requires a reference to MS VBA Extensibility): ... Dim myFile As String ... How do I pass a macro to this opened excel document through code. ...
    (microsoft.public.excel.programming)
  • Save - Yes / No / Cancel
    ... I have found some vba that may " Force users to enable ... hidden except one that says about your macro status. ... other sheets are visable using the very-visable routine. ... status page but because its done that again says "overwrite existing ...
    (microsoft.public.excel.misc)
  • Re: Table transferring HELP!!!!
    ... using a TransferSpreadsheet action in a macro or VBA will *append* the data ... it does not overwrite existing records ...
    (microsoft.public.access.modulesdaovba)
  • Re: Locking(?) an excel session
    ... > While a long macro is running in Excel 2002 VBA, and a user opens another ... > Excel document on the PC, or opens an excel attachment in an email, I ...
    (microsoft.public.excel.programming)