Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hey guy,
I am trying to modify Macro for exporting certain tables to Excell. The only problem is that right now those tables are hard coded into macro and I need to change that to variable. Any help would be much appreciated.
Right now part of my code looks like this:
chartArray = Array("CH944", "CH893", "CH863", "CH878")
Array("CH01", "CH02"))
usedRows=0
For Each chart In chartArray
Set l = ActiveDocument.GetSheetObject(chart)
chartCaption = l.GetCaption.Name.v
I would like to switch this part Array("CH944", "CH893", "CH863", "CH878") with a variable, any ideas on how can I accoplish that??
Hi Andrius,
Have a look at the attached file.
Sub Test
vArray = ActiveDocument.GetVariable("vChart").GetContent.String
chartArray =split(vArray, ",")
For each chart in chartArray
Set l = ActiveDocument.GetSheetObject(Chart)
chartCaption = l.GetCaption.Name.v
Msgbox chartCaption
Next
End Sub
Let us know.
Hi Andrius,
Have a look at the attached file.
Sub Test
vArray = ActiveDocument.GetVariable("vChart").GetContent.String
chartArray =split(vArray, ",")
For each chart in chartArray
Set l = ActiveDocument.GetSheetObject(Chart)
chartCaption = l.GetCaption.Name.v
Msgbox chartCaption
Next
End Sub
Let us know.
Thanks alot Tamil, it worked!
No problem Andrius. Happy weekend .