Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask

Re: Reading from Excel

by cacharbe (Curate)
on Aug 09, 2002 at 18:34 UTC ( #188997=note: print w/replies, xml ) Need Help??

in reply to Reading from Excel

As I mentioned deeper in the response tree, you might need to calculate the page, especially if you have DisplayAlerts = 0 or the cell references data from another sheet.
use strict; 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'); $Excel->{DisplayAlerts}=0; my $Book = $Excel->Workbooks->Open($excelfile); my $Sheet = $Book->Worksheets("Sheet1"); $Sheet->Activate(); $Sheet->Calculate(); #The rest of your GET code here
It's happened to me before.


Flex the Geek

Replies are listed 'Best First'.
Enabling macros
by migs (Initiate) on Aug 10, 2002 at 19:48 UTC
    Hi -

    I am working with hrvoje on this. Our spreadsheet does need enabling of macros. If we run the spreadsheet from MS Excel on desktop, it asks for enabling of macros in a pop-up. Is there any way that all macros in the spreadsheet can be enabled to run programmatically ??

    Thanks and regards

      You'll need set the security settings in the application to "Low" so that they will run on the machine that your script is running. You can't do this programmatically that I have found, but that just makes sense (for obvious reasons).

      You can do this by going to the toolbar and following: Tools->Marco->Security...

      Update and Caveat: This isn't a safe mode to run Excel if this machine is used for anything other than application level access to Excel. You should always implement a strong anti-virus scheme and limit access to machines that need to run in this mode. Audit early, sudit often.


      Flex the Geek

        Has there been an update to this to be able to programmatically? My issue is disabling macros because the OLE for opening the book,that has macros, gets "hung up."

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://188997]
[Corion]: Oh yay. The (external, not guided by me) programmers have chosen Moose+DBIx::Class for some implementation, and now seem to do 1+n SELECT statements for each row, as is usual when using ORMs.
[Corion]: So maybe I should investigate how to plug in a cache in front of DBIx::Class so I can do a ->selectall_hashre f and then satisfy the "sub"-selects from that cached single SELECT statement ...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (7)
As of 2017-09-25 10:59 GMT
Find Nodes?
    Voting Booth?
    During the recent solar eclipse, I:

    Results (279 votes). Check out past polls.