saving an excel file using VBS 
Author Message
 saving an excel file using VBS

hi

i was able to automate an excel file, open it, but if i
want to save like a different excel file using VBS, then
my PC seems like it went on a cyclic process or endless
loop. i checked the excel process and it was still running.

can anybody give a short code how to save an excel file
and close the excel process afterwards?

i used the ff code
Dim xlApp
Set xlApp = CreateObject("Excel.Application")
xlApp.Visible = True
xlApp.Workbooks.Add
xlApp.Range("a1").value = "this is a test"

until here it was running fine, then i include
xlApp.Save("c:\test.xls")
then it went on an endless loop or cyclic process or
standby mode

hope you can help me..

thanks and best regards
archie



Thu, 17 Nov 2005 17:50:23 GMT  
 saving an excel file using VBS
I think it just stopped processing at that point, although it may have
been trying to call up the Save dialog.  The problem is that you need to
use the _workbook_'s save method, and you actually want to do a SaveAs -
that's all in the Excel VBA stuff.

The following would be the new save line:

xlApp.ActiveWorkbook.SaveAs("c:\test.xls")

Quote:

> hi

> i was able to automate an excel file, open it, but if i
> want to save like a different excel file using VBS, then
> my PC seems like it went on a cyclic process or endless
> loop. i checked the excel process and it was still running.

> can anybody give a short code how to save an excel file
> and close the excel process afterwards?

> i used the ff code
> Dim xlApp
> Set xlApp = CreateObject("Excel.Application")
> xlApp.Visible = True
> xlApp.Workbooks.Add
> xlApp.Range("a1").value = "this is a test"

> until here it was running fine, then i include
> xlApp.Save("c:\test.xls")
> then it went on an endless loop or cyclic process or
> standby mode

> hope you can help me..

> thanks and best regards
> archie

--
Please respond in the newsgroup so everyone may benefit.
 http://dev.remotenetworktechnology.com
(email requests for support contract information welcomed)
 ----------
 Microsoft's new UNIFIED Terminal Services Newsgroup:



Thu, 17 Nov 2005 20:55:16 GMT  
 saving an excel file using VBS

: hi
:
: i was able to automate an excel file, open it, but if i
: want to save like a different excel file using VBS, then
: my PC seems like it went on a cyclic process or endless
: loop. i checked the excel process and it was still running.
:
: can anybody give a short code how to save an excel file
: and close the excel process afterwards?
:

set xlApp = CreateObject("Excel.Application")
set xlWB = xlapp.workbooks.add
xlWB.Sheets(1).Range("a1").value = "this is a test"
xlWB.saveas "c:\test.xls"
xlWB.close
xlapp.quit
set xlwb = nothing
set xlapp = nothing



Fri, 18 Nov 2005 06:16:29 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Saving Excel file from the Web using VBS

2. Saving an Excel file without using Excel

3. Saving an Excel file without using Excel

4. How can I save a web page to file using VBS

5. need help: Open Excel, run macro, save file, close Excel

6. Saving Excel file to Excel file

7. Saving a File Using an Excel Cell

8. Save an Excel file using OLE

9. Saving Excel Workbook in ASCII format using VBScript

10. Save embedded excel spreadsheet in access to excel file

11. Calling *.vbs files to Run From Master VBS File

12. how to call vbs file from vbs file

 

 
Powered by phpBB® Forum Software