Can you use datasets in an Excel macro?

  • Thread starter Thread starter CR
  • Start date Start date
C

CR

Is there a way to use datasets in an Excel VBA macro? I currently use
ADO but I have to make sure all the client PC's have ADO installed.
Now that I'm switching all of my VB6 programs to .NET, I'd like to
convert all my macros as well.

Chuck.
 
Hi CR,

I do not know, however a XML dataset is a (very simple) XML file.

So basicly nothing more than a XML file with tags, so why would you not be
able to use that in a macro in Excel.

However, I do not know that.

But I think that you can ask that in an excel newsgroup.

I hope anyhow that this helps a little bit?

Cor
 
Depends on the version and even then, you can do it if you really want to
although it won't be fun. If you are running XP, there's an XML section
under Data. In the old days you'd use Data - Import External Data, New
Database Query.. Now you can go straight to XML and Import XML. You'll need
to add the serialized dataset to the Maps, but then it's good to go. This
may seem like a pain, but on a 1 to 10 it's a 2. All you need to do is use
DataSet.WriteXML("Path:\File.xml") Since you know where you wrote it, you
can tell Excel to look there. XP also has some other pretty wild stuff and
you can hit SharePoint or SqlServer and depending on access and return
types, you can hit a web service too (but there are a lot of 'but's' here so
let me not get too far ahead of myself).

You can also use com interop to write your DS to an excel sheet, but my
experience has been that it's quite slow compared to running straight
macros.

I know I answered this in general terms, If you need any code or have any
specific questions, please let me know

HTH,

Bill
 
I think I'll just wait until mirosoft comes out with office products
that are fully integrated with .NET. I've heard that they will.

Thanks!
 
Back
Top