Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


SaveAs dialog box getting prompted when converting Excel file to HTML

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,62241
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> SaveAs dialog box getting prompted when converting Excel file to HTML
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 SaveAs dialog box getting prompted when converting Exce... - 7/8/2008 9:53:15 PM   
  chirayu

 

Posts: 1
Score: 0
Joined: 7/8/2008
Status: offline
Hello Friends,

I am facing a wierd problem with my VBScript.

In my application, I am allowing the user to user to upload Word, PowerPoint and Excel document. Once the document gets uploaded, I am creating a HTML copy of that document using the VBScript. For Word and PowerPoint document, if an HTML copy of the document already exists then no alert message (related to over-writing the existing HTML file) is prompted. However for Excel document, the alert message (related to over-writing the existing HTML file) is prompted if the HTML file for the same exists.

The VBScript code snippet which is been used is as follows:

       if instr(1, existingDocumentPath, ".doc") <> 0 then
         ' Perform the operations for word document         
         automationObject.activate         
         automationObject.Documents.Open existingDocumentPath         
         automationObject.ActiveDocument.Save         
         automationObject.ActiveDocument.SaveAs newDocumentPath, 8           
       elseif instr(1, existingDocumentPath, ".ppt") <> 0 then
         ' Perform the operations for powerpoint document         
         automationObject.Presentations.Open existingDocumentPath, true
         automationObject.ActivePresentation.SaveAs newDocumentPath, 12   
       elseif instr(1, existingDocumentPath, ".xls") <> 0 then
         ' Perform the operations for excel document      
         automationObject.Workbooks.Open existingDocumentPath
         automationObject.ActiveWorkbook.SaveAs newDocumentPath, 44    
       end if

Please help me by providing any solution to this problem.

Thanks in advance

Chirayu
 
 
Post #: 1
 
 RE: SaveAs dialog box getting prompted when converting ... - 7/8/2008 11:02:40 PM   
  ginolard


Posts: 1053
Score: 21
Joined: 8/10/2005
Status: offline
I think I've come across this before.

If I remember rightly, don't use SaveAs, use Save instead

_____________________________

Author of ManagePC - http://managepc.net
AD Query Template - http://www.visualbasicscript.com/m_40609/tm.htm
Consolidated Scripting Framework - http://www.visualbasicscript.com/m_59109/tm.htm

(in reply to chirayu)
 
 
Post #: 2
 
 RE: SaveAs dialog box getting prompted when converting ... - 7/9/2008 12:13:43 AM   
  dm_4ever


Posts: 2665
Score: 46
Joined: 6/29/2006
From: Orange County, California
Status: offline
Have you tried....

objExcel.DisplayAlerts = False

_____________________________

dm_4ever

My philosophy: K.I.S.S - Keep It Simple Stupid
Read Me: http://www.visualbasicscript.com/m_24727/tm.htm
Frequently Asked Stuff: http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to chirayu)
 
 
Post #: 3
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> SaveAs dialog box getting prompted when converting Excel file to HTML Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts