ShadowFox333
Programmer
I have a bunch of files I need to run charts on using vbscript.
THe code below imports a csv file into a worksheet
and fills the cells with the data I need. What I can't figure out is how to not create a chart (column/bar) and print it.
TIA Bob
Option Explicit
Const vbNormal = 1
DIM objXL, objWb, objR ' Excel object variables
DIM Title, Text, tmp, i, j, file, name
dim rng
file = "00110.csv"
name = "00110"
Function GetPath
' Retrieve the script path
DIM path
path = WScript.ScriptFullName ' Script name
GetPath = Left(path, InstrRev(path, "\"))
End Function
' create an Excel object reference
Set objXL = WScript.CreateObject ("Excel.Application")
objXL.WindowState = vbNormal ' Normal
objXL.Height = 300 ' height
objXL.Width = 400 ' width
objXL.Left = 40 ' X-Position
objXL.Top = 20 ' Y-Position
objXL.Visible = true ' show window
' Load the Excel file from the script's folder
Set objWb = objXl.WorkBooks.Open(GetPath+file)
' Get the loaded worksheet object
Set objWb = objXL.ActiveWorkBook.WorkSheets("00110")
objWb.Activate ' not absolutely necessary (for CSV)
'WScript.Echo "worksheet imported"
THe code below imports a csv file into a worksheet
and fills the cells with the data I need. What I can't figure out is how to not create a chart (column/bar) and print it.
TIA Bob
Option Explicit
Const vbNormal = 1
DIM objXL, objWb, objR ' Excel object variables
DIM Title, Text, tmp, i, j, file, name
dim rng
file = "00110.csv"
name = "00110"
Function GetPath
' Retrieve the script path
DIM path
path = WScript.ScriptFullName ' Script name
GetPath = Left(path, InstrRev(path, "\"))
End Function
' create an Excel object reference
Set objXL = WScript.CreateObject ("Excel.Application")
objXL.WindowState = vbNormal ' Normal
objXL.Height = 300 ' height
objXL.Width = 400 ' width
objXL.Left = 40 ' X-Position
objXL.Top = 20 ' Y-Position
objXL.Visible = true ' show window
' Load the Excel file from the script's folder
Set objWb = objXl.WorkBooks.Open(GetPath+file)
' Get the loaded worksheet object
Set objWb = objXL.ActiveWorkBook.WorkSheets("00110")
objWb.Activate ' not absolutely necessary (for CSV)
'WScript.Echo "worksheet imported"