Open an Excel file from aform in VBA

Closed
NAcho111 - 3 Jul 2009 à 09:28
Excelguru Posts 261 Registration date Saturday 11 April 2009 Status Member Last seen 21 June 2011 - 4 Jul 2009 à 03:39
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
Related:

1 response

Excelguru Posts 261 Registration date Saturday 11 April 2009 Status Member Last seen 21 June 2011 307
4 Jul 2009 à 03:39
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