in reply to Can't call method "Range" on an undefined value at line 16

Hi abhishek1990

its because  $workbook1->Worksheets(1) returns undef

Now you just have to find out why that is :D

Replies are listed 'Best First'.
Re^2: Can't call method "Range" on an undefined value at line 16
by abhishek1990 (Initiate) on Nov 11, 2015 at 09:39 UTC
    that is required as 'm pasting the values in sheet 2. so i have defined the sheet2.

      that is required as 'm pasting the values in sheet 2. so i have defined the sheet2.

      what? This is the sequence

      Q: I get error...

      A: Its because...

      ?: that is required

      You're getting an error, you may require that it simply works, but you're getting an error ... now you have to figure out why, wrong API call, wrong version of office, something else ... Worksheets(1) is returning undef, you have to figure out why,

      I don't have excel