realtoast
New Member
- Joined
- Nov 24, 2015
- Messages
- 47
- Office Version
- 365
- Platform
- Windows
- MacOS
- Mobile
- Web
Experts, I have a macro, GetExcelData (), that retrieves the contents of a single worksheet from a workbook located in a network folder. User clicks a button and, presto, the needed data is deposited in a new worksheet in my affected workbook. Works famously. However, because the macro, based on a Power Query process, creates a very specific query, if someone changes even a single character in a header in the target worksheet the macro crashes.
Is there a means of using a macro/VBA to get generic data from a remote folder and place it in a new worksheet? By generic, I mean, the macro seeks and retrieves whatever data found in the specific network folder.
Example A: NetworkFolder contains an Excel file, Houses.xlsx. That workbook has a single sheet, Sheet1, with three columns, Street, City, Zip. My current Power Query would easily retrieve all that and put it into my active workbook as a new sheet.
Example B: Same as above, but the Excel file located in NetworkFolder is now, Cars.xlsx, a single sheet, named "MyCars" has 5 header fields with various respective data.
Is there a means of having a single, universal macro/VBA that gets the contents of whatever file is presently in NetworkFolder, regardless of the name, contents, or even different sheet names?
If they answer is No, or NFW, that will save me a lot of time. If it is possible, please share.
Thanks!
Is there a means of using a macro/VBA to get generic data from a remote folder and place it in a new worksheet? By generic, I mean, the macro seeks and retrieves whatever data found in the specific network folder.
Example A: NetworkFolder contains an Excel file, Houses.xlsx. That workbook has a single sheet, Sheet1, with three columns, Street, City, Zip. My current Power Query would easily retrieve all that and put it into my active workbook as a new sheet.
Example B: Same as above, but the Excel file located in NetworkFolder is now, Cars.xlsx, a single sheet, named "MyCars" has 5 header fields with various respective data.
Is there a means of having a single, universal macro/VBA that gets the contents of whatever file is presently in NetworkFolder, regardless of the name, contents, or even different sheet names?
If they answer is No, or NFW, that will save me a lot of time. If it is possible, please share.
Thanks!