I have the following vb script, which opens a sheet from a .xlsx file and saves it as a csv file:
if WScript.Arguments.Count < 3 Then
WScript.Echo "Error! Please specify the source path and the destination. Usage: sheet2csv SourcePath.xlsx worksheet Destination.csv"
Wscript.Quit
End If
Dim oExcel
Set oExcel = CreateObject("Excel.Application")
Dim oBook
Set oBook = oExcel.Workbooks.Open(Wscript.Arguments.Item(0))
oBook.Sheets(Wscript.Arguments.Item(1)).SaveAs WScript.Arguments.Item(2), 24
oBook.Close False
oExcel.Quit
I have excel 2003 installed on my PC, but I also have access to Excel 2007 through the windows vApp launcher by running the following command:
"C:\WINDOWS\CCM\VappLauncher.exe" /launch "Microsoft Office Excel 2007 VOE05891.100"
This is the only way I can access Excel 2007 - it is not physically installed on my PC, but Excel 2003 is.
When the script runs, it opens the local instance of Excel 2003. I would like to find a way to modify the VB script so that it uses the virtualised version of Excel 2007 instead. Can anyone help?