Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

xml, Excel, Worksheets...

Status
Not open for further replies.

picu

Programmer
Feb 28, 2002
5
US
I am creating different worksheets for each Contact.

On each contact (or worksheet) I have labels like Name, Address and so on.

I can have the worksheets created on the fly, but can not copy the Name, Address on the other worksheets.

Please, add any code. Thanks!


<%
'Variables
varName = &quot;My Name&quot;
folder = &quot;xls/&quot; 'folder
'creates a name on the server
path = (&quot;&quot; & folder & mgrName & &quot;-&quot;& month(date()) & day(date()) & year(date()) & &quot;.xls&quot;)

'Create Object
set objFSO = createobject(&quot;scripting.filesystemobject&quot;)
set objCTF = objFSO.CreateTextFile(server.mappath(&quot;&quot;&path), true)


objCTF.WriteLine &quot;<html xmlns:x=&quot;&quot;urn:schemas-microsoft-com:eek:ffice:excel&quot;&quot;>&quot;
objCTF.WriteLine &quot;<head>&quot;
objCTF.WriteLine &quot;<!--[if gte mso 9]><xml>&quot;
objCTF.WriteLine &quot;<x:ExcelWorkbook>&quot;
objCTF.WriteLine &quot;<x:ExcelWorksheets>&quot;

'Getting each Value from Form

For Each Thing in Request.Form
For iCount = 1 to Request.Form(Thing).Count

'Get out Buttons
if Thing <> &quot;cmdSubmit&quot; then

objCTF.WriteLine &quot;<x:ExcelWorksheet>&quot;
objCTF.WriteLine &quot;<x:Name>&quot; & Request.Form(Thing)(iCount) & &quot;</x:Name>&quot;
objCTF.WriteLine &quot;<x:WorksheetOptions>&quot;
objCTF.WriteLine &quot;<x:print>&quot;
objCTF.WriteLine &quot;<x:ValidPrinterInfo/>&quot;
objCTF.WriteLine &quot;</x:print>&quot;
objCTF.WriteLine &quot;</x:WorksheetOptions>&quot;
objCTF.WriteLine &quot;</x:ExcelWorksheet>&quot;

end if
Next
Next

objCTF.WriteLine &quot;</x:ExcelWorksheets>&quot;
objCTF.WriteLine &quot;</x:ExcelWorkbook>&quot;
objCTF.WriteLine &quot;</xml>&quot;
objCTF.WriteLine &quot;<![endif]--> &quot;
objCTF.WriteLine &quot;</head>&quot;
objCTF.WriteLine &quot;<body>&quot;
objCTF.WriteLine &quot;<table>&quot;
objCTF.WriteLine &quot;<tr><td>First Line </td></tr>&quot;
objCTF.WriteLine &quot;<tr>&quot;
objCTF.WriteLine &quot;<td>&quot;
objCTF.WriteLine &quot;Name&quot;
objCTF.WriteLine &quot;</td>&quot;
objCTF.WriteLine &quot;<td>&quot;
objCTF.WriteLine &quot;Address&quot;
objCTF.WriteLine &quot;</td>&quot;
objCTF.WriteLine &quot;</tr>&quot;
objCTF.WriteLine &quot;</table>&quot;
objCTF.WriteLine &quot;</body>&quot;
objCTF.WriteLine &quot;</html>&quot;

' close the document
objCTF.close

%>

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top