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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T18:07:32+00:00 2026-05-28T18:07:32+00:00

what is the syntax for this c++ question in Delphi? After using an oleContainer,

  • 0

what is the syntax for this c++ question in Delphi?

After using an oleContainer, and trying to do SaveDocumentAs which didn’t work. I thought this might be a good alternative.

update: thank you for the translation, however the excel file goes curropted after the call

var
  ExcelOle: TOleContainer;
begin
  ExcelOLE.CreateObjectFromFile(FileName, False);
  ExcelOle.OleObject.application.workbooks[1].save;
end;
  • 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-28T18:07:33+00:00Added an answer on May 28, 2026 at 6:07 pm

    Simply create an Ole Object:

    uses ComObj, Excel;
    
    var Excel: OleVariant;
    Excel := CreateOleObject('EXCEL.Application');
    Excel.Application.Workbooks.Add;
    Excel.Application.Workbooks[1].SaveAs('c:\test.xlsx', xlWorkbookDefault); // or xlOpenXMLWorkbook (51)
    Excel.Application.Quit;
    

    Excel.pas

    unit Excel;
    
    interface
    
    uses Windows, Activex;
    
    // originally from Excel97.pas
    // XlFileFormat constants
    type
      XlFileFormat = TOleEnum;
    const
      xlAddIn = $00000012;
      xlCSV = $00000006;
      xlCSVMac = $00000016;
      xlCSVMSDOS = $00000018;
      xlCSVWindows = $00000017;
      xlDBF2 = $00000007;
      xlDBF3 = $00000008;
      xlDBF4 = $0000000B;
      xlDIF = $00000009;
      xlExcel2 = $00000010;
      xlExcel2FarEast = $0000001B;
      xlExcel3 = $0000001D;
      xlExcel4 = $00000021;
      xlExcel5 = $00000027;
      xlExcel7 = $00000027;
      xlExcel9795 = $0000002B;
      xlExcel4Workbook = $00000023;
      xlIntlAddIn = $0000001A;
      xlIntlMacro = $00000019;
      xlWorkbookNormal = $FFFFEFD1;
      xlSYLK = $00000002;
      xlTemplate = $00000011;
      xlCurrentPlatformText = $FFFFEFC2;
      xlTextMac = $00000013;
      xlTextMSDOS = $00000015;
      xlTextPrinter = $00000024;
      xlTextWindows = $00000014;
      xlWJ2WD1 = $0000000E;
      xlWK1 = $00000005;
      xlWK1ALL = $0000001F;
      xlWK1FMT = $0000001E;
      xlWK3 = $0000000F;
      xlWK4 = $00000026;
      xlWK3FM3 = $00000020;
      xlWKS = $00000004;
      xlWorks2FarEast = $0000001C;
      xlWQ1 = $00000022;
      xlWJ3 = $00000028;
      xlWJ3FJ3 = $00000029;
      xlExcel12 =50;
      xlExcel8 = 56;
      xlHtml = 44;
      xlOpenXMLAddIn = 55;
      xlOpenXMLTemplate = 54;
      xlOpenXMLTemplateMacroEnabled = 53;
      xlOpenXMLWorkbook = 51;
      xlOpenXMLWorkbookMacroEnabled = 52;
      xlTemplate8 = 17;
      xlUnicodeText = 42;
      xlWebArchive = 45;
      xlWorkbookDefault = 51;
      xlXMLSpreadsheet = 46;
    
    implementation
    
    end.
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is more of a syntax question I'm trying to write a store procedure
I'm going to ask this question using Scala syntax, even though the question is
This is a follow-up to this question: Using javascript:function syntax versus jQuery selector to
im struggling with syntax here: hopefully this question is v simple, im just miising
EDIT: This question is about finding definitive reference to MySQL syntax on SELECT modifying
This is related to this question I asked earlier about syntax highlighting user-defined blocks
Basic C# syntax question: So I have this class public class BrandQuery<T> : Query<T>
This is hopefully a softball syntax question: I need to call a method with
I have to set GridView.DataKeyNames (This is really a question about the syntax for
I have this syntax which works (since it's from the API, pretty much) <%

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.