> Lynn. Rickards Sent: Wednesday, April 19, 2006 6:02 PM
  >
  >Suresh Govindachar wrote:
  >> Hello,
  >> 
  >>   Issue:  opening an excel file brings up a dialog box
  >>           stating that the "workbook contains links to
  >>           other data sources" and asks if the data
  >>           should be updated.  
  >[...] 
  >>       use Win32::OLE qw(in with);
  >>       use Win32::OLE::Const 'Microsoft Excel';
  >> 
  >>       my $Excel = Win32::OLE->GetActiveObject('Excel.Application') ||
  >>                   Win32::OLE->new('Excel.Application', 'Quit');
  >[...] 
  >>       my $Book  = $Excel->Workbooks->Open($file); # open Excel file
  >>       my $Sheet = $Book->Worksheets(1);           # select worksheet 
number 1
  >>       
  >>          $Book->Close;
  >[...] 
  >
  > my $Book  = $Excel->Workbooks->Open($file, {'UpdateLinks' => 3});
  > 
  > The value 3 I got from some VB code someplace I forget, and 
  > have no clue what it means - hunted on MSDN to no avail. 
  > Anyone?

  From the documentation for the open method:   

  -------8<-------
    Opens a workbook.
    
    expression.Open(FileName, UpdateLinks, ReadOnly, Format,
                    Password, WriteResPassword,
                    IgnoreReadOnlyRecommended, Origin, Delimiter,
                    Editable, Notify, Converter, AddToMru, Local,
                    CorruptLoad)

    expression    Required. An expression that returns the Workbooks
                  object.
    
    FileName   Required String. The file name of the workbook to be
               opened.
    
    UpdateLinks   Optional Variant. Specifies the way links in the
                  file are updated. If this argument is omitted, the
                  user is prompted to specify how links will be
                  updated. Otherwise, this argument is one of the
                  values listed in the following table.
    
    Value | Meaning 
    ------+-------------------------------------------------------
      0   | Doesn't update any references 
      1   | Updates external references but not remote references 
      2   | Updates remote references but not external references 
      3   | Updates both remote and external references 
    
    If Microsoft Excel is opening a file in the WKS, WK1, or WK3
    format and the UpdateLinks argument is 2, Microsoft Excel
    generates charts from the graphs attached to the file. If the
    argument is 0, no charts are created.
  -------8<-------
  >
  > BTW Options to book->Open are fully listed in the Object Browser.
  > 
 
  --Suresh
   

_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to