score:0
i will use vba to launch powershell and run powershell script to download whatever data wanted. it's pretty easy to launch another program in vba, so i am not going to describe it.
here is the powershell script to authenticate with ntlm by giving user/password, btw, you can use usedefaultcredentials=$true
in the following code to use currently logged in user.
for these headers, i just copied from fiddler, you will have to correct them for your usage.
$url = "https://xxx.yyy/team/data.csv"
$request = [system.net.webrequest]::create($url)
$request.method="get"
$credcache = new-object system.net.credentialcache
$creds = new-object system.net.networkcredential("username","password", "domain")
$credcache.add("https://xxx.yyy", "ntlm", $creds)
$request.credentials = $credcache
$request.headers.add("upgrade-insecure-requests", "1")
$request.headers.add("dnt", "1")
$request.headers.add("accept-encoding", "gzip, deflate, br")
$request.headers.add("accept-language", "en-us,en;q=0.9")
$request.useragent = "mozilla/5.0 (windows nt 10.0; win64; x64) applewebkit/537.36 (khtml, like gecko) chrome/71.0.3578.98 safari/537.36"
$request.accept = "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8"
$response = $request.getresponse()
$requeststream = $response.getresponsestream()
$readstream = new-object system.io.streamreader $requeststream
$data = $readstream.readtoend()
if all good, in fiddler, you will see something like following from http headers,
powershell to do the auth and download work, vba to load the downloaded file.
Source: stackoverflow.com
Related Query
- How to use VBA or Powershell to export lists from Sharepoint server with NTLM Authentication to Excel
- How to export the data from excel to word as text use VBA
- How would I use VBA to automatically populate an excel worksheet with data from the pivot table of a separate excel workbook?
- How to work with multiple recordsets out of one procedure from SQL Server in vba
- How do I use Access VBA to export to XML with headings for various records?
- How to extract values from HTML tags with VBA to use in Excel?
- How to use VBA to connect SQL server and export SQL result
- VBA - How to use multiple criteria from a range with wildcards, for autofilter
- How do I use VBA in MS Access to change the address of linked sharepoint lists
- How to use "INSERT INTO" command from Access VBA to Sharepoint
- how to return a value from a stored procedures in a large global corp sql server 13.yyy from ms access 2007-2016 with vba
- How to take variable from sub in Module and use it in another sub in a UserForm with Excel VBA
- How to download the most updated file from Sharepoint with VBA
- How to use version control with VBA code?
- How can I copy columns from one sheet to another with VBA in Excel?
- How to use a SQL SELECT statement with Access VBA
- How to access SQL Server from VBA in a non-deprecated way?
- How to return values from a SQL Server Stored Procedure and Utilise them in Access VBA
- How to use FindWindow to find a visible or invisible window with a partial name in VBA
- How to use the dbSeeChanges option with OpenRecordset when accessing a SQL Server table that has an IDENTITY column?
- How To Use VBA To Share Excel File With Fellow Office User?
- How do I run a Stored procedure with parameters from Excel VBA string?
- How to release inprocess COM Server object from Excel VBA
- How to diagnose syntax error from a parameterized SQL Server query in VBA ADODB
- How can I get og:image from resource with VBA excel
- What error number could I use with CVErr() to indicate no value would be returned from an Access VBA function?
- How to link Access table to SQL Server with VBA
- How to select from excel table with left join in access database - EXCEL VBA
- How to pass values from VBA to a table variable in SQL Server 2008?
- How to populate data from a range (multiple rows and columns) to listbox with VBA
More Query from same tag
- Shapes.Type....Delete in Excel/PPT VBA
- How to select a range in column A that parallel to selected range (the selected range is Non-Contiguous range) without Looping
- TextBox SetFocus not working after handling error and MsgBox VBA Excel
- How do I find out what the Date is for Next Saturday or the current Saturday?
- MSAccess reference a field name from a form into a query and email
- Excel VBA looping multiple columns to find if condition is met
- Pull information from a web table into excel
- PowerPoint O365 - v16 Prevent Screen Updating
- Allowing use of a UDF in one open workbook but make it invisible/unusable/inaccessible in another workbook
- When creating new table and field in vba Access 2000. Getting Error Data Type Conversion Error
- Why is this "Delete Method of Range class failed" error popping up?
- Signed Excel VBA AddIn (*.xlam) not running properly despite installed certificate
- Counting rows with data
- VBA + TransferText + SpecificationName
- Pausing VBA Code
- Excel button that shows the elements of the previous row
- how close the first recordset to get another value form cbox
- using result of input box in vlookup
- how do I get date time including milliseconds in VBA
- Can I create an undo transaction in Word or Excel? (VSTO)
- Compare 2 arrays in VBA and write to another sheet
- Loop to Create Option buttons in a Userform not working
- Anyway To Export Email To Folder Including Attachments?
- Excel VBA Cut or copy and paste on change of cell
- Type mismatch in set frame statement
- Excel VBA: Run-time error '13'': type mismatch due to unrecognized date formats
- LastRow in spreadsheet
- Excel VBA: can't paste my function into a cell
- MS Access Error updating memo field with long text
- How to get full selection from Excel sheet using VBA without the filtered rows that are in between