Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Pass Object Between Functions
#2
Solved: 11 Years, 3 Months, 3 Weeks ago
You still need to set your object. It's a variant type by default which will not have a .Cells method.

Code:
Function WriteExcelSht (excelObjIn)

    On Error Resume Next

    Dim excelObj
    [color=#FF4500]Set excelObj = CreateObject("Excel.Application")[/color]
    excelObj = excelObjIn

    MsgBox "In WriteExcelSht, excelObjIn is: " & excelObjIn & " and     excelObj (the function version) is: " & excelObj
Reply


Messages In This Thread
Pass Object Between Functions - by brianMooney - 11-10-2009, 10:06 PM
RE: Pass Object Between Functions - by jsknight1969 - 11-11-2009, 03:25 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Pass reference to datatable into function smallsteve 2 2,069 09-28-2017, 09:18 PM
Last Post: smallsteve
  Inserting variable values into Descriptive Programming Functions eske99 2 3,510 12-18-2015, 01:47 PM
Last Post: vinod123
  Can you please help me in QTP DP to pass the variable name anshika.agarwal 1 2,744 09-04-2014, 06:43 PM
Last Post: anshika.agarwal
  Passing objects to Functions vinod.nhce 0 3,295 03-13-2014, 06:09 PM
Last Post: vinod.nhce
  vb script to stop execution of functions if conditions fail visitjaga 1 7,380 12-05-2013, 12:26 AM
Last Post: ravi.gajul

Forum Jump:


Users browsing this thread: 2 Guest(s)