View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Greg Koppel Greg Koppel is offline
external usenet poster
 
Posts: 79
Default Creating Charts in Excel 2002 (XP)

Try this code. Put your csv file into a folder called temp on the C drive.

Sub TextImporter()
myFile = Dir("C:\temp\*.csv")
Do Until myFile = ""
Workbooks.OpenText Filename:="C:\temp\" & myFile,
DataType:=xlDelimited, Space:=True
ActiveSheet.Name = myFile
myFile = Dir()
Loop
Charts.Add
End Sub

HTH, Greg

"Tony" wrote in message
...
I am ready to rip my hair out.
The following is the code:

Sub Make_Chart1()
Infile = {name of .csv file being input to routine - deleted for the

discussion}

Workbooks.Open _
Filename:= Infile

Charts.Add {{{ Error occurs here}
...

--- When I open Excel to this macro, I crash at the "Charts.Add" Line with

a "Type Mismatch", although it DOES add the sheet! How do I get past this
fershluggina error??? (BTW: I tried recording PRECISELY the same sequence
in Macro, then when I replayed the sequence I got the same error!!!) PLEASE
Help!