Hi,
Is it possible to fill the author, Title and other property-fields of an excel-file via FiveWin?
Thanks
Marc
Dim properties As Microsoft.Office.Core.DocumentProperties
properties = DirectCast(Globals.ThisDocument.BuiltInDocumentProperties, _
Microsoft.Office.Core.DocumentProperties)
properties.Item("Subject").Value = "Whitepaper"
oWorkBook:BuiltinDocumentProperties("Author") := cAuthor
oWorkBook:BuiltinDocumentProperties("Title") := cTitle
oWorkBook:BuiltinDocumentProperties("Comments") := cComments
Error description: Error Excel.Application:ACTIVESHEET/16389 E_FAIL: _BUILTINDOCUMENTPROPERTIES
Args:
[ 1] = C Test
Stack Calls
===========
Called from: win32ole.prg => TOLEAUTO:_BUILTINDOCUMENTPROPERTIES(0)
#include "FiveWin.ch"
Function Main()
Local oExcel,oWorkBook
oExcel:=CreateObject( "excel.application" )
oWorkBook:=oExcel:Workbooks:Add()
oWorkBook:BuiltinDocumentProperties("Author"):Value := "Anser K.K."
oWorkBook:BuiltinDocumentProperties("Title"):Value := "Test Title"
oWorkBook:BuiltinDocumentProperties("Comments"):Value := "Test Comments"
cFile := 'D:\test.xlsx'
oWorkBook:saveAS( cFile )
oExcel:Quit()
MsgInfo("Done")
Return Nil
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: No registered users and 103 guests