Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

OPEN Excel file WITH VB !?

Status
Not open for further replies.

desprits

Programmer
Feb 14, 2004
40
0
0
CA
When I do that : IT's OK
MsgBox "monExcel.Workbooks.Add PathExcel"
monExcel.Workbooks.Add PathExcel
monExcel.Application.Visible = True

But when I do that : It's cause FATAL error
MsgBox "monExcel.Workbooks.Open PathExcel"
monExcel.Workbooks.Open PathExcel ' HERE ERROR FATAL
monExcel.Application.Visible = True

Why ? Please
 
If you do this
Dim PathExcel As String

PathExcel = App.Path & "\spreadsheet1.xls"

monExcel.Workbooks.Open PathExcel
monExcel.Application.Visible = True

OR

monExcel.Workbooks.Open App.Path & "\SpreadSheet1.xls"
monExcel.Application.Visible = True

U are not telling it what to open.

UKmedia productions
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top