473,382 Members | 1,390 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

asking for a VBS Handling advice

18
Hi everyone!

I have this code that simply opens a .xlsm file and then save it as .xls. The code is working fine, but sometimes at a very small chance, it's already been 10 minutes and the "conversion" is not yet finished, and just leaves an EXCEL.EXE instance on my task manager and a 1890A980.file on my target directory.

I would like to ask for an advice on how to handle this properly since this functionality is deployed on a server.

Btw, my vbs is invoke via cscript command.

The code is:

Expand|Select|Wrap|Line Numbers
  1. On Error Resume Next
  2. Dim ArgObj, var1, var2
  3. Set ArgObj = WScript.Arguments 
  4.  
  5. var1 = ArgObj(0) 
  6. var2 = ArgObj(1) 
  7.  
  8. Set objExcel = CreateObject("Excel.Application")
  9. Set objWorkbook = objExcel.Workbooks.Open(var1)
  10.  
  11. objExcel.DisplayAlerts = 0
  12. objExcel.ActiveWorkbook.SaveAs var2, 56
  13. objExcel.ActiveWorkbook.Close
  14. if err.Number<>0 then
  15.     WScript.Echo "VB-98," + err.Description
  16.     else
  17.     WScript.Echo "VB-00"
  18.     end if
  19. objExcel.Quit
  20. Set    objExcel = Nothing
  21. set ArgObj = Nothing
  22.  
Thanks.
Sep 30 '11 #1
0 989

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Socheat Sou | last post by:
After a brief, but informative, discussion on Freenode's #zope chatroom, I was advised to consult the gurus on c.l.p. I'm working for a small company who is in desperate need to rewrite it's...
11
by: Jim | last post by:
Hi, I keep getting form results emailed to me that would indicate a form from my web site is getting submitted with all fields blank or empty, but my code should preventing users from proceeding...
1
by: Jonathan Fong | last post by:
Hi, I am seeking advice about handling different versions of APIs of office which I am writing a plug-in application for it in C# language. Which is the best way to do? 1. Resolving...
6
by: strvariant | last post by:
Our company contracted with an outside consultant over a year ago to build a complex database application. The end product was put into production over nine months ago. Since then it has been...
3
by: OJLP | last post by:
Hi. I am about to embark on C# learning. I have had limited VB experience. Can anyone offer any advice as to some good books / courses to attend, for a newbie to get the basics as quick as...
2
by: Fraser | last post by:
Hi, I'm needing to update an xml file by inserting a new node. First I need to load the xml into a XmlDocument from file. In the first run, the file won't exist and I will have to create a...
1
by: David Van D | last post by:
Hi there, A few weeks until I begin my journey towards a degree in Computer Science at Canterbury University in New Zealand, Anyway the course tutors are going to be teaching us JAVA wth bluej...
3
by: =?Utf-8?B?RnJhbmsgVXJheQ==?= | last post by:
Hi all I have some problems with Crystal Reports (Version 10.2, Runtime 2.0). In Section3 I have added a OLE Object (Bitmap). Now when I open the report in my code I would like to set this...
3
by: Anders Borum | last post by:
Hello, I've worked on an API for quite some time and have (on several occasions) tried to introduce generics at the core abstract level of business objects (especially a hierarchical node). The...
0
by: Chris Rebert | last post by:
On Mon, Nov 17, 2008 at 10:42 AM, Abah Joseph <joefazee@gmail.comwrote: Have you considered basing this off existing software for schools, like one of the programs listed on...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.