You are currently viewing the BOOK: Professional InfoPath 2003 section of the Wrox p2p Programmer to Programmer discussion community. This is a community of more than 40,000 computer programmers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining our free Wrox p2p community you can post your own programming questions and respond to other programmers’ questions. Registered users also don't have to see the ads that are displayed to guests. Registration is fast, simple and absolutely free so please, join today!
Join today and post to win prizes! Post more to increase your chances of being Wrox’s top poster of the month.
I need to create a button in an InfoPath 2003 form that will insert the data into an existing excel spreadsheet.
I found this code that will do exactly what I want but I need it in jscript (I didn't set programming language to VB prior to creating form, 2007 will remove code but haven't found how to do so in 2003):
Answer
You can try this variation of the code:
Sub CopySelection()
Selection.Copy
Windows("Destination.xls").Activate
With Sheets("Sheet1").Range("A1").CurrentRegion.End(xlD own)
.Offset(1, 0).Select
ActiveSheet.Paste
.Offset(1, 0).Value = .Value + 1
End With
End Sub
This can give an error if the value of column A is not a number, but this shouldn't be the case.
Hope this helps,
Miguel
__________________________________________________ __________________________________________________ ___