User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the JavaScript / DHTML / AJAX section within the Web Development category of DaniWeb, a massive community of 426,933 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,427 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JavaScript / DHTML / AJAX advertiser: Lunarpages Web Hosting
Views: 869 | Replies: 4 | Solved
Reply
Join Date: Jul 2008
Posts: 14
Reputation: karang is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
karang karang is offline Offline
Newbie Poster

A file named 'RESUME.XLW' already exists in this location.

  #1  
Jul 23rd, 2008
Hi

I have a textbox and a button on a html page. On click of button I want to save the value in the textbox to a particular cell of the excel file



I have written the following code



 var ExcelSheet = new ActiveXObject("Excel.Application");


        ExcelSheet.Workbooks.Open("D:\\TEST.XLS");
       
        // Make Excel visible through the Application object.
        ExcelSheet.Application.Visible = false;
       
        // Place some text in the first cell of the sheet.
        ExcelSheet.ActiveSheet.Cells(2,1).Value = document.forms[0].txtName.value ;
       
       
        // Save the sheet.
        ExcelSheet.Save();
        
        ExcelSheet.DisplayAlerts = false;
        // Close Excel with the Quit method on the Application object.
        ExcelSheet.Application.Quit();
        // Release the object variable.
        ExcelSheet = "";


Everything works fine. The value is stored in excel but when I click the button to save I am getting a message

"A file named 'RESUME.XLW' already exists in this location. "

I have also written

ExcelSheet.DisplayAlerts = false;

But still I am getting the message.

Why this message is coming and what is the way to supress it.

Kindly advice



Regards

Karan
Last edited by Tekmaven : Jul 24th, 2008 at 2:15 am. Reason: Code tags
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Jun 2008
Posts: 74
Reputation: Troy III is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 11
Troy III's Avatar
Troy III Troy III is offline Offline
Junior Poster in Training

Re: A file named 'RESUME.XLW' already exists in this location.

  #2  
Jul 23rd, 2008
You can't supress it because it's a System alert! You are overwriting an existing file.

Try:
ExcelSheet.Workbooks.Open("D:\\TEST.XLS", 2, true);
Reply With Quote  
Join Date: Jul 2008
Posts: 14
Reputation: karang is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
karang karang is offline Offline
Newbie Poster

Re: A file named 'RESUME.XLW' already exists in this location.

  #3  
Jul 24th, 2008
Hi

I have implemented your code but after that I am not able to save the excel file implicitly through the application, my system asks me to save the file explicitly.

Regards
Karan
Reply With Quote  
Join Date: Jun 2008
Posts: 74
Reputation: Troy III is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 11
Troy III's Avatar
Troy III Troy III is offline Offline
Junior Poster in Training

Re: A file named 'RESUME.XLW' already exists in this location.

  #4  
Jul 24th, 2008
Yeah that's also a system precaution measure...
I haven't been using this functionality for about 6-7 years now.
I'm not sure,
try ExcelSheet.SaveAs("D:\\TEST.XLS"); , that might supress the confirmation. Or simply close the document with quit command.
Reply With Quote  
Join Date: Aug 2008
Posts: 1
Reputation: quozzle is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
quozzle quozzle is offline Offline
Newbie Poster

Re: A file named 'RESUME.XLW' already exists in this location.

  #5  
Aug 21st, 2008
The .xlw exists when there are recovery versions that haven't been reconciled...I created a few to test. When I put the statement before the save, it stopped giving me the message.

xlApp.AlertBeforeOverwriting = False
xlApp.DisplayAlerts = False
xlApp.Save()
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb JavaScript / DHTML / AJAX Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Other Threads in the JavaScript / DHTML / AJAX Forum

All times are GMT -4. The time now is 12:13 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC