I need to introduce several subroutines (modules ,not functions) in a VB main program(code). The main code and the subroutines use several sheets of an Excel file.

I introduce in the main code the Excel file with the following code:

option explicit
public hoja as object
public sub command1_click()
dim hoja as object
set hoja=createobject("Excel.Sheet")
hoja.application.visible=true

with commondialog1
.cancelerror=true
.filter="sicrosoft excel files(*.xls)¦*.xls"
.dialogtitle="select an excel file for open"
.showopen
end with
hoja.application.workbooks.open commondialog1.filename

My question is : Although I know how to transfer parameters from the main to the subroutines, I do not know how to transfer the Excel file.

Any help? Thanks.