PC Review


Reply
Thread Tools Rate Thread

VBS script to prevent Excel prompt

 
 
New Member
Join Date: Apr 2011
Posts: 1
 
      8th Apr 2011
I have a vbs that convert old xls to a new xls, then saves it.
When the save line executes, it asks:
A file named --- already exists in this location. Do you want to replace it? How can I automated this prompt to replace exiting file? see code below..
<<ednetmanFormatExcel "c:\test\Hourly Priority Report rev.xls"
Sub ednetmanFormatExcel(ByVal vFilePath)
Dim xlApp
Set xlApp = CreateObject("excel.application")
With xlApp.Workbooks.Open(vFilePath) 'open file
With .ActiveSheet
End With
.SaveAs Left(vFilePath, Len(vFilePath) - 5) & ".xls", -4143 '-4143=xlWorkbookNormal
.Close SaveChange=True
End With
xlApp.Quit
Set xlApp = Nothing
End Sub>>
 
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
How can i include a .vbs file in another .vbs file Store a reference of a excel workbook Microsoft Excel Programming 3 3rd Mar 2009 07:56 PM
Windows Script Host "Can not find script file "C:\ntidr.vbs". Craig Windows XP Performance 2 30th Sep 2008 07:03 PM
Same code in VBS file and VB.NET Assembly - VBS works but VB.NET fails Raghu Microsoft VB .NET 2 31st May 2005 10:12 PM
Re: VBS scripts : how to check is the client can use .vbs ? Conrad Lawes Microsoft Windows 2000 Deployment 1 18th Jul 2003 11:57 AM
Re: VBS scripts : how to check is the client can use .vbs ? Gerry Hickman Microsoft Windows 2000 Deployment 2 16th Jul 2003 09:13 PM


Features
 

Advertising
 

Newsgroups
 


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