opening an existing Excel file in Visual Basic


Posted by rudy aguirre on February 08, 2002 7:51 PM

I'm a beginner in manipulating Excel files in VB. I can
create a new Excel file but dont know how to open an
existing Excel file, make changes and save.
Thanks Rudy

Posted by DMV on February 08, 2002 8:14 PM

Workbooks.Open FileName:="file"

Workbooks("Your Workbook").Close SaveChanges:= True



Posted by Ivan F Moala on February 08, 2002 11:15 PM

Just to add to that....I would imagine you
would also have a reference to the excel object
eg. Dim AppExcel as ....

so AppExcel.Workbooks.Open FileName:="full pathname"

Ivan