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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T12:17:54+00:00 2026-06-06T12:17:54+00:00

Any sample to write and read from excel sheet (i need to write values

  • 0

Any sample to write and read from excel sheet (i need to write values in excel sheet file and read other values after excel execute some its functions) using Powerbuilder “OLE”

  • 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-06T12:17:56+00:00Added an answer on June 6, 2026 at 12:17 pm

    Here is a sample of accessing to an Excel file through OLE :

    int li_rtn
    string ls_range
    oleobject lole_excel, lole_workbook, lole_worksheet, lole_range
    lole_excel = create oleobject
    li_rtn = lole_excel.ConnectToNewObject("excel.application")
    if li_rtn <> 0 then
          MessageBox( "Error", 'Error running MS Excel api.')
          destroy lole_Excel
    else
      lole_excel.WorkBooks.Open("C:\some_path_to\sample.xls") 
    
      lole_workbook = lole_excel.application.workbooks(1)
      lole_worksheet = lole_workbook.worksheets(1)
    
      // Set the cell value
      lole_worksheet.cells(1,11).value = "Some value" //it is cells(line, column)
    
      //example to work on a range of cells
      ls_range = "A1:F"+string(ll_excel_rows)
      lole_range = lole_worksheet.Range(ls_range)
      lole_range.Select
      lole_range.Locked = True
    
      // Save
      lole_workbook.save()
      // Quit
      lole_excel.application.quit()
      lole_excel.DisconnectObject()
    
      destroy lole_Excel
    end if
    

    Reading and writing values can be easily done through the worksheet.cells property.

    The only problem is that driving Excel on a large amount of cells through OLE is slow.

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

Sidebar

Related Questions

Do any one have a sample code of how to read and write from/into
I need to delete some rows from csv file based on a column value.
Someone have any sample of Comet app .net? I need one sample how to
Can any one give me a sample code that gets the selected value from
I found this sample but its for web. Can any one check this proj.
I am attempting to write some Java code that takes an image from a
I use the following code (from Bluetooth Chat sample app) to read the incoming
I'm having hard time to find out how to read and write from /into
I did some searching but couldn't find any sample/example. I've a requirement where geo
How can I read from standard input and write to standard output. System.Diagnostics.Process.StandardInput's MSDN

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.