J
Joe
Hi all,
I have two files 1.xls and 2.xls.
1.xls is open
2..xls is not open.
from 1.xls I have to display a form which is in 2.xls
My code is...
'******************************************
' Code in 1.xls
Function WorkbookOpen(ByVal WorkBookName As String) As Boolean
' returns TRUE if the workbook is open
WorkbookOpen = False
On Error GoTo WorkBookNotOpen
If Len(Application.Workbooks(WorkBookName).Name) > 0 Then
WorkbookOpen = True
Exit Function
End If
WorkBookNotOpen:
End Function
'***************************************************
Private Sub Go_Click()
'to initiate the second form
Dim NewFile As String
NewFile = "2.XLS"
If Not WorkbookOpen(NewFile) Then
Workbooks.Open NewFile
End If
' I WANT TO ADD CODE FOR CALLING THE FUNCTION STARTFORM()
' WHICH IN TURN WILL MAKE THE FORM TO BE SHOWN.
' STARTFORM() is in Model1 of 2.xls
Me.Hide
ThisWorkbook.Close False
End Sub
'******************************************
I tried to google, but I get confused. Could not find any specific
result...
I would like to know how I can call the function "STARTFORM()" which
is in the Module1 of 2.XLS.
Thanks a lot.....
Regards
Joe
I have two files 1.xls and 2.xls.
1.xls is open
2..xls is not open.
from 1.xls I have to display a form which is in 2.xls
My code is...
'******************************************
' Code in 1.xls
Function WorkbookOpen(ByVal WorkBookName As String) As Boolean
' returns TRUE if the workbook is open
WorkbookOpen = False
On Error GoTo WorkBookNotOpen
If Len(Application.Workbooks(WorkBookName).Name) > 0 Then
WorkbookOpen = True
Exit Function
End If
WorkBookNotOpen:
End Function
'***************************************************
Private Sub Go_Click()
'to initiate the second form
Dim NewFile As String
NewFile = "2.XLS"
If Not WorkbookOpen(NewFile) Then
Workbooks.Open NewFile
End If
' I WANT TO ADD CODE FOR CALLING THE FUNCTION STARTFORM()
' WHICH IN TURN WILL MAKE THE FORM TO BE SHOWN.
' STARTFORM() is in Model1 of 2.xls
Me.Hide
ThisWorkbook.Close False
End Sub
'******************************************
I tried to google, but I get confused. Could not find any specific
result...
I would like to know how I can call the function "STARTFORM()" which
is in the Module1 of 2.XLS.
Thanks a lot.....
Regards
Joe