excel nagłówek i stopa

0

Wiem że ten temat już był ale może go ktoś dokładniej opisać jak trzeba zmienić kod z makra na delphi i co trzeba zamieścić w :

const
// Page Setup
xlPortrait = 1;
xlLandscape = 2;
xlPaperA4 = 9;

może ktoś ma jakiś prostszy sposób na wstawienie nagłówka i stopki z góry dziękuje

0

excel.ActiveSheet.PageSetup.LeftHeader := 'sss';
excel.ActiveSheet.PageSetup.CenterHeader := 'ww';
excel.ActiveSheet.PageSetup.RightHeader := 'ww';
excel.ActiveSheet.PageSetup.LeftFooter := 'll';
excel.ActiveSheet.PageSetup.CenterFooter := 'ss';
excel.ActiveSheet.PageSetup.RightFooter := 'ss';

0

Ja kozystałem z tego i działa:

const
  xlPortrait            = 1;
  xlLandscape           = 2;
  xlPaperA4             = 9;
begin
ExcelApp.Workbooks[1].Sheets[1].PageSetup.CenterFooter       := 'stopka';
ExcelApp.Workbooks[1].Sheets[1].PageSetup.CenterHeader       := 'nagłówek';
ExcelApp.Workbooks[1].Sheets[1].PageSetup.Orientation        := xlPortrait;

ExcelApp.Workbooks[1].Sheets[1].PageSetup.CenterHorizontally := 2/0.035;
ExcelApp.Workbooks[1].Sheets[1].PageSetup.CenterVertically   := 2/0.035;

ExcelApp.Workbooks[1].Sheets[1].PageSetup.LeftMargin         := 11;
ExcelApp.Workbooks[1].Sheets[1].PageSetup.RightMargin        := 11;
ExcelApp.Workbooks[1].Sheets[1].PageSetup.TopMargin          := 11;
ExcelApp.Workbooks[1].Sheets[1].PageSetup.BottomMargin       := 11;
...

1 użytkowników online, w tym zalogowanych: 0, gości: 1