Consulting

Results 1 to 4 of 4

Thread: VBA to Update Excel Workbook Properties

  1. #1

    VBA to Update Excel Workbook Properties

    Hi Everyone,

    Currently my function is giving all sorts of errors when I try to update the properties (Status).

    Function XclPropertiesUpdt (wb as string, upcond as string)
    
    Dim wbk as Workbook
    
    Select Case upcond
    
    Case "Activate"
    Workbooks.CheckOut (wb)
    Set wbk = Workbooks.Open(wb)
    wbk.ContentTypeProperites("Status").Value = "Active"
    wbk.CheckIn Ture, "Changed report status"
    
    Case "Decommission"
    Workbook.CheckOut(wb)
    Set wbk = Workbooks.Open(wb)
    wbk.ContentTypeProperties("Status").Value= "Decommission"
    wbk.CheckIn True, "Changed to report to be decommissioned"
    
    End Select
    
    End Function
    I would appreciate any help that you can provide. Thanks.

  2. #2
    Moderator VBAX Master georgiboy's Avatar
    Joined
    Mar 2008
    Location
    Kent, England
    Posts
    1,236
    Location
    Without going into detail and testing the code, a couple of bits I notice from reading:

    True not looking good
    wbk.CheckIn Ture, "Changed report status"
    Missing the s on the second CheckOut
    Workbooks.CheckOut wb
    Click here for a guide on how to add code tags
    Click here for a guide on how to mark a thread as solved
    Click here for a guide on how to upload a file with your post

    Excel 365, Version 2405, Build 17628.20102

  3. #3
    snb
    Guest
    Properites
    I think it's more a spectacles issue.
    See: https://www.specsavers.com/

  4. #4
    What a spectacle, indeed (embarrassed). I have been looking at this far too long but not good enough. Thank you guys.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •