I want a VBA code that will search all the sheets and their respective VBA coding in my…
- User
I want a VBA code that will search all the sheets and their respective VBA coding in my workbook 'Service Providers' and extract the line of text that begins G: within the apostrohes " " The data must then be listed in sheet 'Linked Docs' in column L staring from L2 with the location of each find in column M. The sheet 'Linked Docs' must be omitted from the search.
- Assistant
- User
Error Method or data member not found on 'ws.VBProject' on the line 'For Each codeModule In ws.VBProject.VBComponents(ws.CodeName).CodeModules'
- Assistant
Apologies for the oversight. The error you encountered is likely because your workbook does not have the appropriate security settings enabled to access the VBA Project. To resolve this issue, you can follow these steps:
- Open the Excel file where you want to run the VBA code.
- Go to the "Developer" tab on the Excel ribbon. If the "Developer" tab is not visible, you'll need to enable it by going to "File" > "Options" > "Customize Ribbon" and checking the "Developer" option.
- Click on the "Visual Basic" button in the "Code" group. This will open the VBA Editor window.
- In the VBA Editor, go to "Tools" > "References" and make sure the following reference is checked: "Microsoft Visual Basic for Applications Extensibility x.x" (the version number can vary, but it usually starts with 5.3).
After enabling the appropriate reference, you should be able to run the code without encountering the "Method or data member not found" error.
Let me know if you need further assistance!
- User
In my workbook 'Service Providers', search all worksheets including their respective VBA coding, and find all the text between 'G:' ending with either '.docm' or '.docx' or '.txt' or '.csv' or '.xlsx' or '.xlsm'. The list will be copied to column L starting from L2 in sheet 'Linked Docs' and the location of each find copied to column M. Please omit the sheet 'Linked Docs' from the search
- Assistant
- User
Error 'For each may only iterate over a collection object or an array' on 'ws.CodeName' in the line 'For Each codeModule In ws.CodeName'
- Assistant
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.