|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Hi,
Can anyone help ???????? I want a form to load in excel when the file opens and deactivate all other options until the user has made an input into the form and clicked a button. The form is a user form created in VBA Thanks |
|
#2
|
|||
|
|||
|
Hi,
Here is some some code i used before. Hope it helps. 'Excel Template Variables Dim xlRptAp As New Excel.Application Dim xlRptWb As New Excel.Workbook Dim xlRptDst As String Dim xlRptSrcPath As String 'Connect to Excel Set xlRptAp = CreateObject("Excel.Application") 'Make Excel Visible xlRptAp.Visible = True 'define the Excel File directory xlRptSrcPath = "d:\Reports\templates\MyReports.xls" 'Connect to Excel Report Workbook Set xlRptWb = xlRptAp.Workbooks.Open(xlRptSrcPath ) 'Connect to Excel Report Workbook xlRptAp.Workbooks(1).Activate ' call Excel Auto_Open macro to generate the Reports ' call your macro or function to process the Excel file xlRptAp.ActiveWorkbook.RunAutoMacros xlAutoOpen xlRptAp.ActiveWorkbook.Save xlRptAp.Application.ActiveWorkbook.Close xlRptAp.Application.Quit Jim Guo |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > Visual Basic Programming > Loading a Form At startup |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|