|
-
Nov 13th, 2004, 12:47 PM
#1
Thread Starter
Member
VB for Excel,working with subroutines(modules)
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|