ListView数据或数组生成Excel

Post a reply

Confirmation code
Enter the code exactly as it appears. All letters are case insensitive.
Smilies
:D :) ;) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :!: :?: :idea: :| :mrgreen: :geek: :ugeek: :arrow: :angel: :clap: :crazy: :eh: :lolno: :problem: :shh: :shifty: :sick: :silent: :think: :thumbup: :thumbdown: :salute: :wave: :wtf: :yawn: :facepalm: :bravo: :dance: :beard: :morebeard: :xmas: :HeHe: :trollface: :cookie: :rainbow: :monkeysee: :monkeysay: :happybday: :headwall: :offtopic: :superhappy: :terms: :beer:
View more smilies

BBCode is ON
[img] is OFF
[flash] is OFF
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: ListView数据或数组生成Excel

Re: ListView数据或数组生成Excel

Post by tmplinshi » 09 Dec 2016, 08:38

You're welcome. :)

I modified a bit.
v1.04 (2016-12-9) - 'IncludeLvHeader' option now doesn't need to change default listview

Re: ListView数据或数组生成Excel

Post by Marvin1023 » 09 Dec 2016, 05:20

Powerful :roll:
thank you very much :)

with two listview or more use:

Code: [Select all] [Expand]GeSHi © Codebox Plus

Re: ListView数据或数组生成Excel

Post by tmplinshi » 09 Dec 2016, 04:03

Done.

Code: [Select all]GeSHi © Codebox Plus

v1.03 (2016-12-9) - Added support for LV_Colors's AlternateRows/AlternateCols
- Added 'IncludeLvHeader' option

Re: ListView数据或数组生成Excel

Post by Marvin1023 » 08 Dec 2016, 14:22

work with LV_Colors.Cell() and LV_Colors.Row()

Can you add LV_Colors.AlternateRows() and LV_Colors.AlternateCols() And Title column of Gui ListView.

I think your script will be complete.

Thank you.

Re: ListView数据或数组生成Excel

Post by Marvin1023 » 08 Dec 2016, 10:14

Omg. good job :)

Re: ListView数据或数组生成Excel

Post by tmplinshi » 08 Dec 2016, 04:19

v1.02 (2016-12-8) - Fixed some color bugs

Re: ListView数据或数组生成Excel

Post by tmplinshi » 08 Dec 2016, 02:41

v1.01 (2016-12-8) - Added support for saving listview cell colors

Example:

Code: [Select all] [Expand]GeSHi © Codebox Plus

Re: ListView数据或数组生成Excel

Post by tmplinshi » 08 Dec 2016, 00:13

Oh, I misunderstood you question before. I thought you were asking "is it working", but your real qustion is "Does this library save cell colors as well to the Excel file?". :) Well, I'll have a try.

Re: ListView数据或数组生成Excel

Post by Marvin1023 » 07 Dec 2016, 23:41

Thank for reply
I will look at how to add color in excel file.

Re: ListView数据或数组生成Excel

Post by tmplinshi » 07 Dec 2016, 23:37

Marvin1023 wrote:This work with [Class] LV_Colors ?

Hi, this library is used to creating Excel file, data either from array or listview.

  • Excel.CreateByArray(OutputFileName, InputArray)
  • Excel.CreateByHLV(OutputFileName, ListViewHwnd)

LV_Colors does not affect ListView data. So yes.

Re: ListView数据或数组生成Excel

Post by Marvin1023 » 07 Dec 2016, 23:10

This work with [Class] LV_Colors ?

Re: ListView数据或数组生成Excel

Post by bolang » 29 Oct 2015, 04:59

谢谢,最近一直在处理excel,用VBA方便很多。

ListView数据或数组生成Excel

Post by tmplinshi » 26 Sep 2015, 10:40

生成 Excel 文件主要有几下几个方法:
  1. 把数据保存到剪贴板,然后一次性粘贴到 Excel
  2. 逐个设置每个单元格的数据...
  3. 设置 Excel 某个矩形区域的值为安全数组(SafeArray)
    示例

Class_Excel.ahk 用的是方法3。

例1 - 用数组生成 Excel 文件

Code: [Select all]GeSHi © Codebox Plus

#Include Class_Excel.ahk

arr := [ ["编程语言", "官网"]
, ["AutoHotkey", "http://ahkscript.org"]
, ["aardio", "http://bbs.aau.cn/"] ]

Excel.CreateByArray("test.xlsx", arr)


例 2 - 用 ListView 数据生成 Excel 文件

Code: [Select all] [Expand]GeSHi © Codebox Plus



Class_Excel.ahk --> https://gist.github.com/tmplinshi/7e2d75794e58def0d43e

Top