Consuming excel connection

magnus101

New Member
Joined
Apr 11, 2012
Messages
36
Hello,
This is a 2 part question.

#1
In vba I can create a data connection and put the data on a worksheet.
However, in vba can I create a data connection and just read the data?
Without writing the data to a worksheet?

#2
If in one workbook I have a named range, with a data value.
When I create a data connection to that workbook and place the connection on the page,
My named range with one value turns into a table. With my value as the header.
Is there a way to get a named range and have it just a single text in the master workbook?

thank you
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
hi

#1. VBA can connect to data, such as via ADO or ADO, and populate a recordset. No data need be written to a worksheet. You can work with the recordset object in VBA. It is like an array, you can loop through and do things. In ADO there are some methods that can be used, such as for filtering.

#2. Maybe in the connection string you can define that there are no headers.

HTH
 
Upvote 0

Forum statistics

Threads
1,223,888
Messages
6,175,207
Members
452,618
Latest member
Tam84

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