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 675059
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T00:46:34+00:00 2026-05-14T00:46:34+00:00

I have tried the following program for writing the contents into Spreadsheet. I downloaded

  • 0

I have tried the following program for writing the contents into Spreadsheet.
I downloaded the Spreadsheet_Excel_Writer package also.

<?php
ini_set('include_path','/xhome/rekha/public_html/PHP_FORUM/PHP/open_office/Spreadsheet_Excel_Writer-0.9.2/Spreadsheet/Excel/Writer.php');

$workbook = new Spreadsheet_Excel_Writer();
$workbook->send('grades.xls');
$format_bold =& $workbook->addFormat();

$format_bold->setBold();

$worksheet =& $workbook->addWorksheet();

$worksheet->write(0, 0, "NAME", $format_bold);
$worksheet->write(0, 1, "MARK1", $format_bold);
$worksheet->write(0, 2, "MARK2", $format_bold);
$worksheet->write(0, 3, "MARK3", $format_bold);
$worksheet->write(0, 4, "MARK4", $format_bold);
$worksheet->write(0, 5, "MARK5", $format_bold);
$worksheet->write(0, 6, "TOTAL", $format_bold);

$workbook->close();
?>

But while running this php program I got the following Fatal error.

Fatal error: Class 'Spreadsheet_Excel_Writer' not found in /xhome/rekha/public_html/PHP_FORUM/PHP/open_office/spread.php on line 4
Call Stack
#   Time    Memory  Function    Location
1   0.0003  59868   {main}( )   ../spread.php:0

I tried to solve this error.But I can’t.
Please can anyone help me to solve this error.

  • 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-05-14T00:46:35+00:00Added an answer on May 14, 2026 at 12:46 am

    you’ll have to include the library, otherwise PHP won’t recognize the Spreadsheet_Excel_Writer class.

    And you’ll also have to specify a path for the include_path, instead of a file.
    And usually it’s best practice to append your new path, to the existing path. So you’ll first have to retrieve the current include_path and append your new path to that one.

    This should work:

    <?php
    ini_set('include_path',ini_get('include_path').':/xhome/rekha/public_html/PHP_FORUM/PHP/open_office/Spreadsheet_Excel_Writer-0.9.2/');
    
    require_once 'Spreadsheet/Excel/Writer.php';
    
    $workbook = new Spreadsheet_Excel_Writer();
    $workbook->send('grades.xls');
    $format_bold =& $workbook->addFormat();
    
    $format_bold->setBold();
    
    $worksheet =& $workbook->addWorksheet();
    
    $worksheet->write(0, 0, "NAME", $format_bold);
    $worksheet->write(0, 1, "MARK1", $format_bold);
    $worksheet->write(0, 2, "MARK2", $format_bold);
    $worksheet->write(0, 3, "MARK3", $format_bold);
    $worksheet->write(0, 4, "MARK4", $format_bold);
    $worksheet->write(0, 5, "MARK5", $format_bold);
    $worksheet->write(0, 6, "TOTAL", $format_bold);
    
    $workbook->close();
    ?>
    

    And it seems that you’ve downloaded the source of the Spreadsheet_Excel_Writer and installed it manually in your project.

    I suggest you use the PEAR installer, included with PHP to install this package. The PEAR libraries are usually included by default through he default include_path. So you should only need the ‘require_once’ statement. no need to change the include_path.

    just enter on the command line:

    pear install Spreadsheet_Excel_Writer-beta
    

    Once you’ve installed the library successfully using PEAR, you can remove the ini_set line from your script.

    Hope this solves your problem.

    Further informations regarding PEAR:
    http://pear.php.net/manual/en/guide.users.commandline.cli.php

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

Sidebar

Related Questions

I am writing a program that should have the following layout: I've tried this
I'm writing a program to simulate an artificial neural network. I have the following
I have tried following queries to get my facebook fan page insights data SELECT
I have tried the following <input type=file name=upload multiple=multiple value=MyText> However the text on
I have tried the following MySQL update but it only sets the first field
I have tried the following: <%= image_tag '...path_to_img', :filter => alpha(opacity=50) %> But it
I have tried the following code but has no effect: Imports system.Runtime.InteropServices <DllImport(UxTheme.DLL, BestFitMapping:=False,
I have tried the following code: $('a.buildMenu').click(function (event) { // Prevent normal behaviour event.preventDefault();
I have tried the following but it seems the folder gets created on the
I have no idea why this wont work but I have tried the following:

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.