radoslaw19

New Member
Joined
Dec 17, 2014
Messages
3
Sub output_into_files()


Dim CONNECT As New ADODB.Connection
Dim zapytanie As New ADODB.Recordset
Dim path As String
Dim name As String
Dim a As Integer
Dim sheetValue As String
Dim QueryString As String




path = "SOME PATH...."


name = Dir(path)


a = 1
sheetValue = "sheet" & a


Do Until name = ""


CONNECT.Open "Driver={Microsoft Excel Driver (*.xls, *.xlsx, *.xlsm, *.xlsb)};DBQ=" & path & name & ";"

QueryString = "INSERT INTO Sheet" & a & " VALUES ('test')"



Call zapytanie.Open(QueryString, CONNECT)
CONNECT.Close




name = Dir
a = a + 1
Loop


End Sub

--------------
the error message is as follows: ms database engine could not find the object sheet1 - it is a runtime error

the files which i want to export values to, exist for sure - i created them myself



Could you please help me with this? s
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
You are in the Power BI forum, I would move to the "main" excel forum for help -- but I have NO idea what zapytanie is either...
 
Upvote 0

Forum statistics

Threads
1,216,309
Messages
6,130,005
Members
449,552
Latest member
8073662045

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