开发者

extract data from an excel to a dictionary object in VBS

开发者 https://www.devze.com 2023-02-28 12:48 出处:网络
i have an excel with three columns (item, price, qty) and i need to extr开发者_如何学Pythonact this data to a dictionary object using VBScript. how do i do this?2 ways of doing this are

i have an excel with three columns (item, price, qty) and i need to extr开发者_如何学Pythonact this data to a dictionary object using VBScript. how do i do this?


2 ways of doing this are

  1. Connect to the Excel workbook via ADO, and treat it as a database. This allows you to run SQL queries against your data to extract your required information. See this. The reference is for VBA and VB but it's easily adapted for VBScript
  2. Open the workbook using the Excel.Application OLE automation object. Something like this is quite easy to find on the internet. This method is similar to using VBA API as you would do within Excel itself and so means you can record macros in VBA and easily adapt them to VBScript.

If you post more information about what you've tried so far or more details of your problem I might be able to give you an example specific to you

0

精彩评论

暂无评论...
验证码 换一张
取 消