Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Save excel Range as CSV file
#1
Hi Guys,

I need a macro to do the follow steps.

1. Open the file C:\BASE\sales.xlsx (if not open)

2. Copy the range Sheet1!A1Big Grin21

3. Save this range as a CSV File (C:\BASE\data.csv)

I will run this macro every 30 seconds, so it's important to have an error handler to repeat the step until it gets sucessfull.

Thanks a lot for helping!!!!
#2
Macro Macro2708
Code:
Copy      Help
;1
ExcelSheet es.Init("Sheet1") ;;assuming that the file is already open. Other parameters of this function will probably allow you to fully implement step 1.
;2
ARRAY(str) a; es.CellsToArray(a "A1:D21")
;3
ICsv x._create
x.FromArray(a)
x.ToFile("C:\test\data.csv")

;results
run "C:\test\data.csv"
#3
Great!!!
Thank youuu!


Forum Jump:


Users browsing this thread: 1 Guest(s)