Open an Excel file from aform in VBA

Closed
Report
-
Posts
261
Registration date
Saturday April 11, 2009
Status
Member
Last seen
June 21, 2011
-
Hello,

I am having trobules trying to open an excel file from a form using VBA I can open a file using the next code:

Workbooks.Open Filename:="Z:\06 Elaboración\Prueba 3.0\Agua.xls"
ThisWorkbook.Close
Sheets("Agua").Select
Load Agua
Agua.Show



The problem is that the file that I need to open also have forms but it does not open automatically

I will apreciate your help a lot

1 reply

Posts
261
Registration date
Saturday April 11, 2009
Status
Member
Last seen
June 21, 2011
307
Hi Nacho111

Change the sequesnce to this

Workbooks.Open Filename:="Z:\06 Elaboración\Prueba 3.0\Agua.xls"
Sheets("Agua").Select
Load Agua
Agua.Show
ThisWorkbook.Close
6