Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I don't have much knowlegde of VB and i'm trying to save an exported excelfile without overwriting the other.
sub export
set MyTable = ActiveDocument.GetSheetObject("CH21")
MyTable.ExportEx "C:\temp\overview_1.xls",5
end sub
that's the code behind my button so each time i press it i want to create an overview_2, overview_3, ...
pls help 🙂
Hello,
If you always need to add a sequence number to your files, you can create a variable vFileSeqNo and using the following code
Sub export Set MyTable = ActiveDocument.GetSheetObject("CH21") Set vSN = ActiveDocument.Variables("vFileSeqNo") vSNs = vSN.GetContent.String MyTable.ExportEx "C:\temp\overview_" & vSNs & ".xls",5 vSN.SetContent vSNs +1, trueEnd Sub
Hope that helps