Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello.
I have an issue with an export i'm trying to do and does not work.
I have a script module in a trigger on post reload action that exports an excel file from a chart.
The script is :
Sub ExportFiles
Pathcorp="c:\sales\"
Set corp = ActiveDocument.GetSheetObject("CH01")
If store_id="101" then
corp.ExportBiff Pathcorp & "Sales.xls"
End if
End Sub
The store_id is field.
How can i export only the data for the store "101"
Can anyone help me ?
Thank you in advance
Maybe this works:
replace your if with
ActiveDocument.Fields("store_id").Select "101"
Joerg
Maybe this works:
replace your if with
ActiveDocument.Fields("store_id").Select "101"
Joerg
It works.
Thank you very much
Hi,
Try this
Create Variables from UI
1. vPathcorp ---> Your desired path to save the exported excel file
2. vstore_id ---> Your store selection (should always one at a time)
Sub ExportFiles
Set Pathcorp = ActiveDocument.Variables("vPathcorp")
Set store_id = ActiveDocument.Variables("vstore_id")'Pathcorp="c:\sales\"
Set corp = ActiveDocument.GetSheetObject("CH01")
If store_id.GetContent.String="101" then
corp.ExportBiff Pathcorp.GetContent.String & "Sales.xls"
End if
End Sub