Solved

EXCEL STUFF

Posted on 2006-06-16
2
186 Views
Last Modified: 2010-04-30
HI, i just want Excel to stop asking me if i want to replace a file...

the code look like this:

Dim oXL As Object        
Dim oBook As Object      
Dim oSheet As Object    
...
...
..
Set oXL = New Excel.Application
 Set oBook = oXL.Workbooks.Open("PATH")
 Set oSheet = oBook.Worksheets.Item(1)
...
...
oSheet.Cells(x,y) = bla, bla, bla
...
...
oBook.SaveAs App.Path & "\" & FileName & ".xls" ' HERE IS THE PROBLEM

is there any flag that indicates, from VB, to stop asking if i want to replace the file?

thanks.

0
Comment
Question by:patobrown
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 5

Accepted Solution

by:
lunchbyte earned 125 total points
ID: 16921942
if dir(oBook.SaveAs App.Path & "\" & FileName & ".xls") <> "" then kill oBook.SaveAs App.Path & "\" & FileName & ".xls"
0
 

Author Comment

by:patobrown
ID: 16922109
Thanks,  it works, but i found in the Intenet:

oXL.DisplayAlerts = False
oBook.SaveAs App.Path & "\" & nombrelocal & ".xls"
oXL.DisplayAlerts = True

it works too.

thanks anyway.

0

Featured Post

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question