VBA
84 TopicsAccess Releases 6 Issue Fixes in Version 2209 (Released September 26)
Our newest round of Access bug fixes was released on September 26. In this blog post, we are highlighting some of the fixed issues that our Access engineers released in the current monthly channel build 2209.6.8KViews4likes1CommentAccess fixes released in Version 2410
Initial release Version 2410 (Build 18129.20116). Bug Name Issue Fixed Memory leak when using the Properties collection in VBA code Every time there was a reference to the Properties collection (e.g. obj.Properties("Text")) in VBA code, Access would leak memory. If this was done a large number of times, the memory usage of Access could increase significantly. Please continue to let us know if this is helpful and share any feedback you have.724Views3likes0CommentsWhat does the "sourcedoc" part of a SharePoint filepath represent?
Hi all, I've been working on opening sharepoint files with VBA (reference PowerPoint decks via a ribbon button). I'm using "Application.ActivePresentation.FollowHyperlink SharePointPath" which is working fine. The constant SharePointPath is the direct SharePoint link for the files I want, which takes this form: https://tenant.sharepoint.com/:p:/r/sites/sitecollection/_layouts/15/Doc.aspx?sourcedoc=%7BB60C7EC5-A285-4BC7-9B0B-B98A148A26D7%7D&file=filename.pptx I've been testing different combinations of replacing the file in place, changing the filename, etc. to see how this can be broken and have noticed a strange behaviour. When I: - Uploaded a different file to the same folder - Deleted the original file - Renamed the new file to the filename of the old file I got a different "sourcedoc" (the bit in blue), however, the original link still worked. To play out the example: - I uploaded a file, which had this path https://tenant.sharepoint.com/:p:/r/sites/sitecollection/_layouts/15/Doc.aspx?sourcedoc=xxxxxx&file=originalfilename.pptx (this path was put in the constant "SharePointPath" in VBA) - I uploaded a new file, which had this path https://tenant.sharepoint.com/:p:/r/sites/sitecollection/_layouts/15/Doc.aspx?sourcedoc=yyyyyy&file=newfilename.pptx - I renamed the new file to the filename of the original file, which then had this path https://tenant.sharepoint.com/:p:/r/sites/sitecollection/_layouts/15/Doc.aspx?sourcedoc=yyyyyy&file=originalfilename.pptx - Then tried "Application.ActivePresentation.FollowHyperlink SharePointPath" WITHOUT updating SharePointPath (so the path was the xxxxxx path) and it still successfully opened the new file. So my question is, what is that "sourcedoc" reference? What does it represent and why didn't it matter that I changed it? I have seen it is a "document_GUID" but not clear on how it works why it didn't matter that it changed8.4KViews2likes2Comments'Calling' a function from within a Word document
I know this is probably really basic but this will be my first real dive into Word VBA, I am quite experienced in Excel VBA, though. I am having difficulty getting my head around how Word 'knows' that a 'block of text' is code, rather than just text of the document. As my first 'excursion', within Word VBA, I am seeking to split a phrase, when it is passed, through mail merge, from an Excel spreadsheet to a Word document. With apologies for i. the fact that my interface to this forum does not permit me to see all the proper formatting options for code and ii. the following is more of a 'storyboard' version of code, rather than the proper thing. The relevant Excel spreadsheet is used to support a group of mail merge letters and this 'issue' is only relevant to one letter, so I do not wish to redesign the spreadsheet; I would prefer to handle the 'issue' within Word, through VBA code. I will focus on two mail merge fields, within this question. The 2 mail merge fields are called, for the sake of simplicity here, i) Relative_Name and ii) Relative_Relationship. Relative_Relationship contains, for example, the value "Second Cousin Twice Removed of the Husband of my Second Cousin Once Removed", and, just to make up a name, Relative_Name contains "Walter Gerard Montague". Now when I simply include the fields in the other letters I simply type - Based on reviewing the online tree which has brought you to my attention, I can see that your tree includes «Relative_Name». Your relationship to me: «Relative_Relationship». and I would end up with a final merged text that reads - Based on reviewing the online tree, which has brought you to my attention, I can see that your tree includes Walter Gerard Montague. Your relationship to me: Second Cousin Twice Removed of the Husband of my Second Cousin Once Removed. On this occasion, though I want to split the contents of the field Relative_Relationship into two halves, through passing it to a VBA macro, so that I would end up with - Based on reviewing the online tree, which has brought you to my attention, I can see that your tree includes Walter Gerard Montague. Walter Gerard Montague is the Husband of my Second Cousin Once Removed and you are his Second Cousin Twice Removed. Now for the sake of the following let's call the VBA function, which I propose to write, Relationship_Phrase_Split. Now here is the nub of my question, how does Word know I am invoking the subroutine when I write, in the mail merge document, something that maybe looks like - Based on reviewing the online tree, which has brought you to my attention, I can see that your tree includes «Relative_Name». Relationship_Phrase_Split(«Relative_Relationship», maybe some other fields from the Excel spreadsheet to control how the splitting is done, e.g. «Gender»). I have only italicised, in the above, just to highlight where I am needing assistance to understand how to cause Word to process the code. I am not asking for help on the split function, only the correct syntax for calling it, please. I have made the document a .docm extension. With thanks in anticipation. Philip Bendigo, VioctoriaSolved4.1KViews1like2CommentsPrinting based on Cell value - VBA???
Hello All - first time post. Not a rookie to Excel, but no expert either. I am stuck trying to automate a print function. I have a table which is 4 columns as follows: Full Name | Rating | Comments | Performed By In the "Preformed by" field, i have my staff, and there are repeats of staff. So this column (column D) has repeats of "John Smith" (3x), Sam Jones (4x), Mike Adams (1x). Each of the other columns, while there may be repeating information, should be treated as independent data (so a name of Sue Smith, which may repeat once or twice is not related to the important column of "Performed By"). I want to print each range of values for a particular staff person on an individual page (or pages if necessary) to hand out to that person individually. So is staff person John Smith has 5 reviews, that the customer name, the rating and comments all print on a single page, in a table format in the same manner as though I manually selected that range of values and printed using the "Print Selected" function. I have attached a sample spreadsheet to demonstrate. I need each staff person's reviews, customer name and rating to print on a single page based on the staff persons name. ONE CLICK or FUNCTION I have 30 staff, each with more than a few ratings to print for them, so I am looking for a way to automate this in some way, and I figure VBA is probably the best option..? I am open to providing more input as needed. Feel free to ask. Thanks so Much Justin Michigan4.7KViews1like4CommentsRecovering a VBA protect password
I wrote a database in 2009/2010 in 2007. I migrated it to 2010, changed it to an accdb and password protected the VBA. In 2017, I left the company, handed over all of my passwords, and left my code in another's hands. In Sept 2021, they asked me to please come back, I did, and the password to the DB I am trying to recover was lost. I have tried using HxD, which doesn't work with accdb. How can I recover the password?9.5KViews1like5CommentsNeeds Help with Some Editing of A Code
Help me edit this code to achieve this end result. As much as possible, please keep the format the same for "select case" and "Loop" Sub QuestionFive() Dim r, c As Integer Do While r < 20 r = 1 Do While c < 20 c = 1 Select Case Cells(20, 20) Case (r + c) Mod 2 Cells(r, c).Interior.Color = RGB(255, 255, 0) Cells(r, c).Interior.Color = RGB(255, 255, 255) End Select r = r + 1 Loop c = c + 1 Loop E nd SubSolved1.8KViews1like5Comments