When you say "expands all fields in a table", I assume it is a pivottable.
From the API Guide:
set chart = ActiveDocument.Activesheet.CreatePivotTable
set gp = chart.GetProperties
gp.TableProperties.PivotAlwaysFullyExpanded = true
You could write a macro that would set the PivotAlwaysFullyExpanded property to true.
Then export to Excel.
Then set the PivotAlwaysFullyExpanded property to false.
Thank you Michael. I was going to implement your suggestion but during a meeting yesterday was told that macros in QlikView are very unstable over the internet. As I was wanting to publish my app to QV Server, I'm not sure that it would be worth the time to put a macro into my app only for it to be faulty because of the net.