Windows Perl Scripting Forums » Scripts

win32::ole unable to open excel workbook

(2 posts)

No tags yet.

  1. Anonymous

    Hello All,

    I m using the following to open and close excel files and access sheets.
    my $Excel = Win32::OLE->GetActiveObject('Excel.Application')
    || Win32::OLE->new('Excel.Application', 'Quit');

    # turn off all the alert boxes

    my $book=$Excel->Workbooks->Add();
    my $sheet=$book->Worksheets("Sheet1");


    This works fine on excel 2007. However, on excel 2010 it seems to not be able to open the file second time and errors out with the following message:
    Can't call method "Worksheets" on an undefined value at ...

    Any ideas why excel can be re-opened after closing on excel 2010?
    Appreciate your help.

    Posted 7 years ago #
  2. Anonymous

    I read all the codes and it seems right, so i think maybe this is cause any other mistake by the way i will search for it and try to find any legit solution bout this.

    ebook reader

    Posted 7 years ago #

RSS feed for this topic


You must log in to post.