Open an Excel file from aform in VBA

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