View Single Post
 
Old 01-25-2019, 09:50 PM
Kenneth Hobson Kenneth Hobson is offline Windows 10 Office 2016
Advanced Beginner
 
Join Date: Jun 2018
Posts: 37
Kenneth Hobson is on a distinguished road
Default

I did some testing but since I had knee surgery today, I was not able to finish it.

The yellow error is due to maybe running it before? Simply delete the Data > Query and Connection and the ListObject. I select all the sheet and Clear for ListObject.

For the extra sheet, that is due to ActiveWorkbook.Workbooks.Add. Comment out or delete that line.

The last thing is getting the f string right. I worked a bit on it but more is needed. I don't like the long string used in the recorder. If Structured right, you can see more easily how to fix it and see what it does. In the Query, it will error. Open the Query dialog to give you clues to debugging.

Since you are adding to the ActiveSheet, why not do the Data > for worksheets import rather than ActiveWorkbook? The sheet method does not have the explicit data types so your formula string will just include and array of integer data types rather than explicit one. The field/column names is shorter too.

I most test code. On one computer it worked fine. On this other, it is showing some issues that you ran into.

I will have a solution for you tomorrow if you have not tweaked it to work fully by then.
Reply With Quote