Dim xls As Workbook, Dim Csv As ????

S

Simon

When you deine xls you use workbook, e..g Dim xls As Workbook, Set xls
= Workbooks.Open

What about with csvs, should they simply be:

Dim csv
Set csv = .Open

Thanks fro your help
 
J

joel

When you don't put a type in a DIM statement is automatically becomes
variant. The CVS file gets opened as a workbook and it still
workbook. The CSV file is just text an you cannot permantely change th
formaing or add formulas because the file is saves only the tex
portions of the cell information
 
P

Peter T

A csv file opens as a Workbook

Dim sFile as string
Dim wb As Workbook

sFile = "c:\<path>\filename.csv"
set wb = Workbooks.Open(sFile)

Regards,
Peter T
 
Top