Buttonni ichiga yozilgan kod


Download 1.64 Mb.
Sana18.06.2023
Hajmi1.64 Mb.
#1595447
Bog'liq
Dasturlash dedlayn



Buttonni ichiga yozilgan kod


//---------------------------------------------------------------------------

#include


#include
#include
#pragma hdrstop

#include "Unit1.h"


//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
Variant app, books, book, sheets, sheet, cells, cell;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button1Click(TObject *Sender)
{
app=CreateOleObject("Excel.Application");
app.OlePropertySet("Visible",true);
app.OlePropertyGet("Application").OlePropertyGet("Workbooks").OleProcedure("Add");
books=app.OlePropertyGet("Workbooks");
book=books.OlePropertyGet("Item",1);
sheets=book.OlePropertyGet("Worksheets");
sheet=sheets.OlePropertyGet("Item",1);
sheet.OlePropertySet("Name", WideString("Talabalar ro`yxati"));
cells=sheet.OlePropertyGet("Cells");
cell=cells.OlePropertyGet("Item",1,1);
cell.OlePropertySet("Value", WideString(Edit1->Text));
}
//---------------------------------------------------------------------------

Download 1.64 Mb.

Do'stlaringiz bilan baham:




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling