zip - Save logfile within Excel file using VBA -
i trying develop manner in vba track changes in document without having hide contents in sheet within workbook.
i understand if change extension of excel file ".zip", can access excel document components sorted directories. there way save , write text file within 1 of these directories can access every time document opened, without having have user drag log file along excel document?
some facts:
- when excel opens file, file blocked excel. there no possibility write file within vba
- you can store additional data file externally or after excel workbook has been closed
- you need have code externally workbook accomplish writing file after has been closed. may want use vsto or oldschool excel addin.
- you have ensure excel not destroy changes when restructuring or repairing file.
in first run, idea sounds natural, not use sheets programmer's point of view. have full control on excel files when
- you use external libraries (e.g. spreadsheet gear) or
- you remote control excel via automation.
- you use openxml sdk excel
- you use vba
you insert additonal information , take care information not skipped excel.
when want tracking way, suggest use excel addin. there no need installation when using kind of addin. attach open workbook , close workbook events , ensure changes written excel workbook after has been closed. have attach kind of other events track changes workbook. may need have in mind there can more 1 workbook opened @ time.
actually there alternatives.
- write logging code in vba or whatever fits
- abstract away how persist code (e.g. use data provider)
think these 2 alternatives store logging data:
- you can save logging data in cells of excel. when using "newer" version of excel, have limit of 1 million rows. may want implement rolling mechanism ensures never go on border of 1 million records. (you may dont want track million changes)
- you can use document properties store information xml.
last not least, obvious: why not using excel's functionality of tracking changes? understand track changes in excel 2013
Comments
Post a Comment