CodeVerge.Net Beta


   Item Entry   Register  Login  
Microsoft News
Asp.Net Forums
IBM Software
Borland Forums
Adobe Forums
Novell Forums




Can Reply:  No Members Can Edit: No Online: Yes
Zone: > Asp.Net Forum > general_asp.net.getting_started Tags:
Item Type: Date Entered: 6/17/2005 9:51:40 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
NR
XPoints: N/A Replies: 8 Views: 20 Favorited: 0 Favorite
9 Items, 1 Pages 1 |< << Go >> >|
"tinybunny_8" <
NewsGroup User
Software Development Kit help!!!6/17/2005 9:51:40 PM

0

I am trying to go through the sample in SDK for Excel. To build the sample, it says that I have to set the environment table Excel table.

1. Does it mean system variable or user variable?
2. It gives instruction for Office 2000 and XP, but I have 2003. I found excel.exe under Office11 folder, is this the correct file for 2003?

Then, it says that I have to type "nmake" on the command line. Is it talking about command prompt? If so, it says that "command is not recognized."

Please help!!! thank you in advanced.

Irma
"Xanderno" <>
NewsGroup User
Re: Software Development Kit help!!!6/18/2005 12:22:51 AM

0

I'm confused...Can you please clarify how ASP.Net figures into this?  (I assume that it does, since this is an ASP.Net forum)
"tinybunny_8" <
NewsGroup User
Re: Software Development Kit help!!!6/18/2005 6:13:32 PM

0

Hi Xanderno,

Yes, I am working on a ASP.NET website, and I need to implement excel application on a page (please see my thread "update excel on web"). Someone told me that maybe I could check  .NET Software Development Kit (programs->Microsoft .NET Framework SDK 1.1-> Samples and quickstart tutorials).
I hope this clarifies your confusion, and maybe you could help me with my question.

"Xanderno" <>
NewsGroup User
Re: Software Development Kit help!!!6/18/2005 9:58:05 PM

0

Ehh...I can't find that particular post.  If you could post a link, I'd be happy to take a look at it.

As to the current question, you'll find the environmental variables in your computer settings, and if you have Visual Studio, into the Visual Studio tools, run the Visual Studio command prompt, and nmake *will* be recognized from there.  (Assuming, possibly, that you've installed the C++ components.)
"tinybunny_8" <
NewsGroup User
Re: Software Development Kit help!!!6/18/2005 10:38:55 PM

0

Xanderno,

Here is the link....

http://forums.asp.net/960678/ShowPost.aspx
.
I really appreciate your help...

Irma
"Caddre" <>
NewsGroup User
Re: Software Development Kit help!!!6/18/2005 11:53:31 PM

0

Office 11 is Office 2003 and try the link below for more info about NMake.  Hope this helps.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vcug98/html/_asug_overview.3a_.nmake_reference.asp
Kind regards,
Gift Peddie
"Xanderno" <>
NewsGroup User
Re: Software Development Kit help!!!6/19/2005 2:40:22 AM

0

Oy...I think, that it's going to be most cost-effective (most likely) for you to buy a component that supports this sort of interaction out of the box.  Something like this: http://officewriter.softartisans.com



"tinybunny_8" <
NewsGroup User
Re: Software Development Kit help!!!6/21/2005 1:04:44 PM

0

Hi Xanderno,

I found a way to work around this. It works well on my machine, but it crashes on the development server. I am not quite sure why because I just copied and pasted it. Incase you want to know the code:

Private objExcel As New Excel.Application

Private wb As Excel.Workbook

Private strSQL As String

Private ds As New DataSet

Private dr As DataRow

Private strConn As String

Private eventDel_BeforeBookClose As Excel.AppEvents_WorkbookBeforeCloseEventHandler

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

If Not IsPostBack Then

Dim file As FileInfo

Dim file2 As FileInfo

file = New FileInfo("C:\Junk\coba.xls")

file2 = New FileInfo("C:\Junk\coba2.xls")

' If the workbooks already exist, prompt to delete.

If Dir("C:\Junk\coba.xls") <> "" Or Dir("C:\Junk\coba2.xls") <> "" Then

If Dir("C:\Junk\coba.xls") <> "" Then file.Delete()

If Dir("C:\Junk\coba2.xls") <> "" Then file2.Delete()

End If

strConn = "Provider=Microsoft.Jet.OLEDB.4.0;" & _

"Data Source=C:\Junk\coba.xls;" & _

"Extended Properties=""Excel 8.0;HDR=YES"""

Dim conn As New OleDbConnection

conn.ConnectionString = strConn

conn.Open()

Dim cmd1 As New OleDbCommand

cmd1.Connection = conn

cmd1.CommandText = "CREATE TABLE SalesPromo (UPC char(255), store_num char(255))"

cmd1.ExecuteNonQuery()

strSQL = "Select * from salesPromotion "

ds = DataHandler.GenDataSet(strSQL, DataHandler.GetConnStr())

For Each dr In ds.Tables(0).Rows

cmd1.CommandText = "INSERT INTO SalesPromo (UPC, store_num) values " & _

"('" & dr("UPC") & "', '" & dr("store_num") & "')"

cmd1.ExecuteNonQuery()

Next

conn.Close()

wb = objExcel.Workbooks.Open("C:\Junk\coba.xls")

Dim strWorkSheetName As String = "SalesPromo"

Dim sbExcelData As System.Text.StringBuilder

Dim aWorkSheet As Excel.Worksheet

 

aWorkSheet = CType(wb.Sheets(strWorkSheetName), Excel.Worksheet)

aWorkSheet.Activate()

eventDel_BeforeBookClose = New Excel.AppEvents_WorkbookBeforeCloseEventHandler(AddressOf BeforeBookclose)

AddHandler objExcel.WorkbookBeforeClose, eventDel_BeforeBookClose

objExcel.Visible = True

lblStatus.Text = "Please click the button "

End If

End Sub

Private Sub BeforeBookclose(ByVal wb As Excel.Workbook, ByRef cancel As Boolean)

wb.SaveAs("C:\Junk\coba2.xls")

'Close running excel app

objExcel.Quit()

'Use the Com Object interop marshall to release the excel object

ReleaseComObject(objExcel)

objExcel = Nothing

'force a garbage collection

System.GC.Collect()

End Sub

Private Sub UpdateDB()

Try

strConn = "Provider=Microsoft.Jet.OLEDB.4.0;" & _

"Data Source=C:\Junk\coba2.xls;" & _

"Extended Properties=""Excel 8.0;HDR=YES"""

Dim conn2 As New OleDbConnection(strConn)

Dim da As New OleDbDataAdapter("Select * From SalesPromo", conn2)

Dim ds As DataSet = New DataSet

da.Fill(ds)

Dim dr As DataRow

For Each dr In ds.Tables(0).Rows
lbl.Text = dr("UPC") & " " & dr("store_num")

Next

conn2.Close()

Catch ex As Exception

lbl.Text = ex.Message.ToString

Catch exDB As OleDbException

lbl.Text = exDB.Message.ToString

End Try

End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

UpdateDB()

lblStatus.Text = "DB is updated."

End Sub

 

"Xanderno" <>
NewsGroup User
Re: Software Development Kit help!!!6/22/2005 1:05:02 AM

0

I'm glad that you found a solution that'll work for you.  As to the error on the development server (if you haven't gotten it sorted yet) I can't say for sure what it is, particualar without the error message but it's most likely either: 1) Excel isn't installed on the server, or 2) DCOM permissions aren't set properly for the ASPNET account/process to access and instantiate Excel.

Also note that while this solution is fine if you don't have a lot of use, it *will not* scale, so if you've got a heavy traffic application, you're going to be better off looking at another solution.

9 Items, 1 Pages 1 |< << Go >> >|


Free Download:













how to create personal website with asp.net

using assembly registered as com library in vbscript

showing the userid as a label in a loginview

yet another drop down list question...

display information using html

refresh and datatypes

substring

httpwebrequest and javascript

some confusion with ddl's attribute

casting int to string

how insert asp.net variable into html code

how to do this?

cpu usage for a process

required code for printing a page.

asp validation contols

how do i use a class?

display something in a datagrid only if certain value....

custom sorting using repeater control

pre-populating fields with info already gathered

notify via aim or msn

refer assemblies in gac

how to get the weather forecast from the other website(public website)?

error tracking

dispaly flash file in aspx file

changing module1.vb

visual basic and asp.net

user control question. urgent !!!

advice request - how do i get started - what did you do?

forum software & vs 2005

data table empty

any way to avoid unit conversion errors?

cant find a proper reference for namespace that includes remoteservice

paging like google

automatically reset fields at midnight....

image is not loaded - strange problem

deletecache!! why? how? when?

request.querystring;

asp.net web application hangs and won't start

how to get value from client-side prompt

is it okay to spawn a worker thread and not care about its return?

aspx.cs page

how to display data that from sqldatasource on textbox?

internal web server problem

controls for windows forms

open source full website

date format

programatically send file to ftp server

getting system information using visual basic 2005

passing arguments

how do i access objects inside my user control?

   
  Privacy | Contact Us
All Times Are GMT