Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8356655
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T10:15:08+00:00 2026-06-09T10:15:08+00:00

I have been working on a project on a Windows 7 system, using StrawberryPerl

  • 0

I have been working on a project on a Windows 7 system, using StrawberryPerl v 5.014 and Win32::OLE.

I am trying to use a second PC running Windows XP SP3, to have the same project developed in parallel. On the new system, I have installed Strawberry Perl v 5.016, and used cpanp to install Win32::OLE and Win32::OLE::Const.

I am using the same script sources in the new system.

It turns out that in the new system, somehow

use Win32::OLE::Const 'Microsoft Excel';

is not having an effect. I am getting the error:

Bareword "xlExcel8" not allowed while "strict subs" in use in StatementExcel.pm line 159.

This error does not show up in the first, original system I mentioned.

What to do?

TIA, Helen

Here’s some excerpts from the program:

package  StatementExcel;
require  Exporter;
@ISA   = qw(Exporter);
@EXPORT  = qw(LoadExcel ProcessPreparedSheet);
use strict;
use warnings;
use Encode;
use 5.016;
use utf8;
use Win32::Console;
use autodie; 
use warnings    qw< FATAL  utf8     >;
use StateConversion;
use Carp;
use Win32::OLE  qw(CP_UTF8);
use Win32::OLE::Const 'Microsoft Excel';
use Cwd;
use Text::CSV::Unicode;
use File::BOM qw( :all );
use List::MoreUtils 'first_index';
...
$xlBook -> SaveAs( $xlFile, xlExcel8);

$i = Win32::OLE->LastError();
if ($i) {
   PrintT $parms{LogStructRef}{HANDLE}, "Error trying to save Excel file:\n", $i;
}   # end if ($i)
PrintT $parms{LogStructRef}{HANDLE}, 'Press <return> to continue...';   # Wait for user input...
$j = <STDIN>;
# Clean up
$xlBook->{Saved} = 1;
$xlApp->Quit;
$xlBook = 0;
$xlApp = 0;
...

Note: cross-posted on PerlMonks: http://www.perlmonks.org/?node_id=985596

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T10:15:10+00:00Added an answer on June 9, 2026 at 10:15 am

    It turns out that the problem occurs because of differences in the OLE object library between Excel 2010 and Excel 2003.
    On the Win XP system, Excel 2003 is installed. On the Windows 7 system, Excel 2010 is installed. When saving the Excel file, I am instructing it to save it as an Excel 2003 “xls” format (and not in the “xlsx” format of Excel 2010) using the “xlExcel8” OLE constant.

    It turns out that this constant does not exist in the OLE 2003 object library.

    The solution was simple: save the file without specifying format – it used the default.

    See also: http://www.perlmonks.org/?node_id=985780

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working with a C# project using System.Windows.Form to create the GUI, I have
I have a windows forms user control in my project. It has been working
I have been working on a project in C# (.net4). Project pretty much allows
I have been working on a project on and off, but I haven't touched
Situation I have been working on a project lately where the UI development seems
So I have been working on this project for a short while now. I
Hey so I have been working on a project that I want to be
I have been working on an opencv project for iOS. I was given a
I have been working on a huge ETL project with 150+ tables and during
I have been working on a C# 4.0 WPF project and need to figure

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.