Free Support Forum - aspose.com

Aspose.Excel- eg.. Northwind.aspx is locked for editing

hi All,

I’ve been trying the excel component and I had the error with my reports and now when trying the Example (Invoice) reports, again.
ie
File in Use,
Northwind.aspx is locked for editing

the result is I cannot create a new report from the aspx page.
How do I , what do I do, to get past this ??

TIA
Neal

Hi Neal,

Please try to search “MS Excel” in your task manager and kill it.

Hi Laurence,

I did , it worked , however the next problem presents itself, ie

I get a blank excel (aspx ) for rendered to me,
even the Sheet name does not reflect the name I specified..(it shows 'Northwind.aspx")
(I have used a copy of Northwind.aspx and modified it accordingly (primarily as per the Invoice example), The data is being "PUT", but nothing displays.

Any ideas??
(my code beneath)

Dim sheets As Worksheets = excel.Worksheets
Dim sheet As Worksheet = sheets(0)

sheet.Name = "ASPOSE Calndr"
Dim cells As Cells = sheet.Cells
SetInvoiceStyles(excel)

startRow = 1
CreateInvoiceHeader(cells, excel, startRow)
startRow = startRow + 2

For l = 0 To intRowCnt
For k = 0 To 5
cells(startRow, k + 1).PutValue(CType(arrPrdDaysActs(l, k), String) &
Chr(10) & Chr(13) & arrPrdDaysLoc(l, k))
cells(startRow, k + 1).Style = style3
Next
startRow = startRow + 1
Next

excel.Save("UCT TimeTable " & Dept & ".xls", SaveType.OpenInBrowser, FileFormatType.Default, Me.Response)

TIA
Neal

Hi Neal,

1. Does the demo work fine in your machine?
2. Do you put your code at Page_Load event?

Hi Laurence,

Yep, the demo works fine (once xl is removed from the task manager).

Yep, The code routine (ie the code i submitted) is called from Page Load.
I do redirect from my DataGrid Page to this page (in fact its the Northwind.aspx page, just with all the other reports / links etc removed and the Invoice one modified to handle my data&nbspWink.
ie

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

Dim license As License = New License()
license.SetLicense(“Aspose.Excel.lic”)
Dim excel As Excel = New Excel()

Try
Create_TT_Report(excel)
Catch er As Exception
’Roll err.message and stacktrace out to log/display
End Try
End Sub

What if you change your Create_TT_Report method to:


Dim sheets As Worksheets = excel.Worksheets
Dim sheet As Worksheet = sheets(0)
sheet.Cells(“A1”).PutValue(“Hello world”)

excel.Save(“book1.xls”, SaveType.OpenInBrowser, FileFormatType.Default, Me.Response)

Hi Laurence,

No luck I’m afraid,
Each first time it seems to invoke MS Excel and the error message “Northwind.aspx is locked for editing”, comes up, (with Notify, Read Exit options),
I then go to task manager and kill MS Excel,. and nothing gets transferred.

I Stop the run, restart the run and the transfer takes place and northwind.aspx is transferred but without any data ie a blank Page, (nothing ie “HelloWorld” in A1).

(I have searched the app. and there are no references to MS Excel).

Thanks
Neal

Hi Neal,

1. Which version of MS Excel are you using? Aspose.Excel doesn’t need MS Excel to create the file. But when you open the generated file at the client, MS Excel is needed.

2. Could you please zip and post your project here? I will check it.

3. Please update your windows and IE to the latest patch.

4. You can try to use another machine to access your web page.

Hi Laurence,

Ok, to answer your questions.

I am running this from my dev machine ie using Localhost.
am using Win XP sp2 , IE 6.0, MS Excel 2000/2 v9.0

Attached is the calling and called pages. (They are dbase dependant however)
I have not included all the Db classes, i suggest just comment the rtns out, … all of them, and just keep the call to reports.aspx (formerly northwind.aspx but renamed to get around the aspx file locked for editing issue). (it gets passed a DS via a session variable.

Thanks
Neal

Your environment is same as mine. I test your reports.aspx in my machine and all work fine.

Please try your program in another machine. That may be a problem of MS. And could you please try OpenInExcel option?

Thanks, it was a problem on my old machine (MS and Dot Net 2001 ) being the problem.
rgds
Neal