IExplorer. Load informaion from Web form into Excel Sheet
IExplorer. Load informaion from Web form into Excel Sheet
Rate IExplorer. Load informaion from Web form into Excel Sheet
(2(2 Vote))
Dim xlApp
Dim xlSheet
Dim xlBook
Dim RemotePath
k=1
TemplatePath="\\MachineName\E\Application\WebReport\Template\Report.xlt"
SavePath="\\MachineName\E\Application\WebReport\Reports\"
Set xlApp=CreateObject("Excel.Application")
xlApp.Workbooks.Add (TemplatePath)
Set xlBook = xlApp.Workbooks(1)
Set xlSheet = xlBook.Sheets(1)
xlSheet.Activate
For each Control in OrderForm
If Control.Title="Profile" Then
xlSheet.Cells(k, 1).Value=Control.name & ": "
xlSheet.Cells(k, 2).Value=Control.Value
k = k + 1
End IF
Next
xlSheet.Range(xlSheet.Cells(1,1),xlSheet.Cells(k,2)).Columns.AutoFit
sDate=GetDate(Date())
sSaveName=OrderForm.CustName.value & "-" & GetTime(Now) & ".xls"
xlSheet.Activate
Call CreateDir(RemotePath)
sSaveName=SavePath & sSaveName
xlBook.SaveAs sSaveName
Set xlSheet = Nothing
If Not xlBook Is Nothing Then Call xlBook.Close
Set xlBook = Nothing
If Not xlApp Is Nothing Then xlApp.Workbooks.Close
If Not xlApp Is Nothing Then xlApp.Application.Quit
Set xlApp = Nothing
bOpen=msgbox("File saved as: " & sSaveName & Chr(13) & "Do you want to open it?" ,VBYesNo)
if bOpen=6 Then window.open sSaveName
End Sub
IExplorer. Load informaion from Web form into Excel Sheet Comments
No comments yet — be the first to post one!
Post a Comment