- February 17, 2016 at 11:05 am #35371
I am essentially wanting Excel to return a variable from PowerShell and input it into an activeworkbook on a Sharepoint server. Is this possible? I am wanting to excecute everything from Excel, so when data is imputed, it will initiate the PowerShell query, and when it obtains the information, I want it to dump the results into the Active Workbook that I am in. I have attempted to search via the internet, but really could only find information on creating new workbooks. Would love some insight, or best resource on how to accomplish my goal.
Thank you,February 18, 2016 at 10:31 am #35440
So... if you want all the code to run in Excel, you'll be running Visual Basic for Applications (VBA), which is all Excel supports in terms of programming languages. VBA could probably launch a PowerShell instance to do something for you, and probably capture its output, but what you do with that will still be a VBA question since you're executing in Excel.
VBA's pretty old, and I'm not sure where to point you in terms of resources for connecting to SharePoint, or if it's even feasible.February 19, 2016 at 1:23 pm #35488
Doug Finke has some code for use in Powershell Specifically for working with Excel.
You can find the code here:
For Working with SharePoint online this module has been very useful for me:
I wrote up a short article on how to use PnP PowerShell:
Hopefully that helps a little, not sure if you are on or off premises.February 24, 2016 at 12:44 pm #35643
Thank you guys for your wisdom. Ideally I would like to remove Excel from the equation in it's entirety, but it is the easiest way to grant access for the users that would be updating data for the query.
You must be logged in to reply to this topic.