Documentazione HotXLS

LoadVBAProjectFromFile metodo

Carica un payload di storage OLE VBA di un XLS classico da un file composto. Il file di origine deve contenere _VBA_PROJECT_CUR o _VBA_PROJECT come storage di primo livello. Il metodo sostituisce qualsiasi payload VBA già collegato alla cartella di lavoro

Sintassi

funzione LoadVBAProjectFromFile(FileName: WideString): Integer;

Valore restituito

Restituisce 1 when the payload is loaded; returns a negative value if the file cannot be opened o does not contain a supported VBA storage

Esempio

if Workbook.LoadVBAProjectFromFile('C:\Reports\MacroPayload.ole') = 1 then
  Workbook.SaveAs('C:\Reports\MacroWorkbook.xls', xlExcel97);

Vedere also