Updating file author attribute with vb

The VBA project contains two modules and one class module: Content of the VBA project as shown in the project explorer in the VBE mod Demo contains the code that demonstrates the use of the class module cls Edit Open XML. The project also uses the Microsoft XML library to ease working with the XML, as shown in the following screenshot of the references: References of the VBAProject Also, a couple of other libraries are put to use: the File Scripting Object and the Windows Shell application object, both through late binding as shown later on.

I have derived a class module that is able to perform the following tasks: In order to be able to work with the files contained within the Open XML zipped file structure, the first step that is needed is to unzip the content of the file.

Auto CAD 2016, Auto CAD Architecture 2016, Auto CAD Civil 3D 2016, Auto CAD Electrical 2016, Auto CAD MEP 2016, Auto CAD Map 3D 2016, Auto CAD Mechanical 2016, Auto CAD P&ID 2016, Auto CAD Plant 3D 2016, Auto CAD Structural Detailing 2016, & Auto CAD Utility Design 2016 When a field is updated, the latest data is displayed.

For example, the value of the File Name field is the name of the file.

I think the formatting saved with the file is the thing that is occasionally corrupting the file.

Download Book1.xls, Book2.xls, Book3.xls, Book4and Book5and add them to "C:\test\" Situation: Note: the Dir function supports the use of multiple character (*) and single character (?

I've also tried placing your code into a class module as a function....but, I'm not sure how to get a value returned to use for my form's unbound text box. Nevermind, I found some code from Terry Kreft: Pass the filename and 0 for the creation date 1 for the last access date 2 for the last write date (modified) ************************************************** 'Code Start ************************************************** Private Const OPEN_EXISTING = 3 Public Const INVALID_HANDLE_VALUE = -1 Private Const GET_CREATE_DATE = 0 Private Const GET_LAST_ACCESS_DATE = 1 Private Const GET_LAST_WRITE_DATE = 2 Private Type FILETIME dw Low Date Time As Long dw High Date Time As Long End Type Private Type SYSTEMTIME w Year As Integer w Month As Integer w Day Of Week As Integer w Day As Integer w Hour As Integer w Minute As Integer w Second As Integer w Milliseconds As Integer End Type Private Declare Function File Time To System Time Lib "kernel32" _ (lp File Time As FILETIME, lp System Time As SYSTEMTIME) As Long Private Declare Function File Time To Local File Time Lib "kernel32" _ (lp File Time As FILETIME, lp Local File Time As FILETIME) As Long Private Declare Function Get File Time Lib "kernel32" (By Val _ h File As Long, lp Creation Time As FILETIME, lp Last Access Time _ As FILETIME, lp Last Write Time As FILETIME) As Long Private Declare Function Create File Lib "kernel32" Alias "Create File A" _ (By Val lp File Name As String, By Val dw Desired Access As Long, _ By Val dw Share Mode As Long, By Val lp Security Attributes As Long, _ By Val dw Creation Disposition As Long, By Val dw Flags And Attributes As Long, _ By Val h Template File As Long) As Long Private Declare Function lclose Lib "kernel32" Alias "_lclose" (By Val _ h File As Long) As Long Function File Time Info(In File Name As String, Which Time As Integer) As Date Dim dte Ret As Date Dim h File As Integer Dim Creation Time As FILETIME Dim Last Access Time As FILETIME Dim Last Write Time As FILETIME Dim Local Time As FILETIME Dim Sys Time As SYSTEMTIME On Error Go To File Time Info_err h File = Create File(In File Name, 0&, 0&, 0&, OPEN_EXISTING, 0&, 0&) If h File = INVALID_HANDLE_VALUE Then Err.

Date Created Set fso = Nothing Set f = Nothing ---------------- I get a runtime error: "Invalid Procedure Call or Argument" on clicking.

Can I use these functions to rebuild a complicated Excel file from scratch?

File thousands of formulas, data tables, named ranges etc and it has been versioned for over 5 years in our company.

Leave a Reply