>What is the best way to open an Excel spreadsheet from within VB?
>
>I am using getobject which has worked fine up until now, but when the path of the xls file has a space in it, it just crashes on me.
>
>How do I do this correctly?
It works correctly!!! See this sample:
Private Sub Command1_Click()
Dim objX As Object
Set objX = GetObject("d:\emoreau\test space\test.xls")
objX.Application.Visible = True
objX.Parent.Windows(1).Visible = True
End Sub
Éric Moreau, MCPD, Visual Developer - Visual Basic MVP
Conseiller Principal / Senior Consultant
Moer inc.
http://www.emoreau.com