Unable to use Microsoft.ACE.OLEDB.12.0 with Excel16 64-bit

Guinaba

Board Regular
Joined
Sep 19, 2018
Messages
217
Office Version
  1. 2016
Platform
  1. Windows
Hi guys,

I am trying to get the data from a .xlsb file using ADODB but keep getting the error below:

Run-time error '446':
Object doesn't support named arguments


I've activated the Microsoft ActiveX Data Objects 6.1 Library and I am using Excel16 64bit. Any suggestions?

VBA Code:
Sub GetDataFromClosedFile()

   Dim cn As ADODB.Connection 
   Set cn = New ADODB.Connection
   
   cn.ConnectionSting = _
        "Provider=Microsoft.ACE.OLEDB.12.0;" & _
        "Data Source=S:\Everyone\Demand Planning\Primary & VE\Woolworths\WW Daily Scan Sales\Daily Sales 20210708.xlsb;" & _
        "Extended Properties='Excel 12.0 ;HDR=YES';"
        
    cn.Open
       
    cn.Close
End Sub
 

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
Have you installed the ODBC drivers for Microsoft.ACE.OLEDB.12.0?
Go to settings ODBC and look for this driver.
 
Upvote 0
Have you installed the ODBC drivers for Microsoft.ACE.OLEDB.12.0?
Go to settings ODBC and look for this driver.
Hi @RayFrye,
These are the available drivers in my machine. I don't see any ACE.OLEDB.12 there, do you mind sharing your screen so I can see what I have to look for.

1625813243234.png
 
Upvote 0
@Guinaba what data are you trying to get?
Hi @johnnyL,

Trying to get the data into excel from another close excel file (xlsb) because is a big file! I did tried powerquery but was taking too long to exctract all these data, so now I'm trying to find an alternative. Any suggestion?
 
Upvote 0
Please refer to post #4. I asked you what data you are trying to get and you responded with 'the data'. Any particular sheets, all sheets, please be more specific.
 
Upvote 0
Please refer to post #4. I asked you what data you are trying to get and you responded with 'the data'. Any particular sheets, all sheets, please be more specific.
Try to get just one big sheet with 800000 rows, just showing you the structure below. I need to read this data from this file grouping the data which is daily into weekly buckets.

DateDescriptionMeasure NamesRef NoStateUOMMeasure Values$ CodeDepartment
8/01/2021​
RSPCA Aprvd Chkn Breast Stir Fry 500gSmth
2841​
WAEA
413​
$3,471.31​
1618800​
Meat
8/01/2021​
RSPCA Aprvd Chkn Breast Stir Fry 500gSmth
2841​
VICEA
848​
$7,603.51​
1618800​
Meat
 
Last edited by a moderator:
Upvote 0
@Guinaba So you want to 'scrape' a range of data from a sheet in a closed workbook?

Do you know the sheet name in the closed workbook that you want to scrape data from and what exact range do you want to scrape data from in the sheet in the closed workbook Ex: A1:J800000?
 
Last edited:
Upvote 0
I suspect that @johnnyL will be better placed to help you on using ADODB going forward but in terms of your immediate problem try this:-

VBA Code:
Sub GetDataFromClosedFile()

    Dim cn As ADODB.Connection
    Set cn = New ADODB.Connection
 
    Dim strWorkbook
    strWorkbook = "S:\Everyone\Demand Planning\Primary & VE\Woolworths\WW Daily Scan Sales\Daily Sales 20210708.xlsb"

    With cn
        .Provider = "Microsoft.ACE.OLEDB.16.0"
        .ConnectionString = "Data Source=" & strWorkbook & "; Extended Properties=""Excel 16.0 Macro; HDR=YES"""
        .Open
    End With
  
    cn.Close
End Sub

I can't quite remember which of these were essential but in case it helps:-

1625817082199.png
 
Upvote 0
@Guinaba So you want to 'scrape' a range of data from a sheet in a closed workbook?

Do you know the sheet name in the closed workbook that you want to scrape data from and what exact range do you want to scrape data from in the sheet in the closed workbook Ex: A1:J800000?
So you want to 'scrape' a range of data from a sheet in a closed workbook?
Correct, grouping the daily bucket into weekly bucket

The sheet name is: Dump
The file path is: S:\Everyone\Demand Planning\Primary & VE\Woolworths\WW Daily Scan Sales\Daily Sales 20210708.xlsb
The range: A1:J800000
 
Upvote 0

Forum statistics

Threads
1,214,985
Messages
6,122,606
Members
449,089
Latest member
Motoracer88

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top