Message 1 of 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello,
How can I send WorkSheet (Excel) to Function?
Second option is making workbook global, but I can’t do it.
I added "Microsoft Access 16.0 Object Reference Library"
Public Sub Main()
Set oExcel = CreateObject("Excel.Application")
Set oBook = oExcel.Workbooks
Set objWorkbook = oBook.Open("E:\test.xlsx")
Set oSheet = objWorkbook.Worksheets(1)
Call Save_to_excel(ref_number, "A", oSheet )
objWorkbook.Save
End Sub
Sub Save_to_excel(oSheet As WorkSheet)
'do sth
End Sub
Solved! Go to Solution.