Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 70
Default Copying Excel File Problem

Hello,

I'm trying to the following scenario in Excel2007:

1) Reading binary data for an Excel workbook file and saving these binary
data in Database
2) Reading the binary data from the database and saving it to a file by
using File.Write mehtod of .Net
3) When openning the file in Excel2007, i get the following message "Excel
completed file level validation and repair. Some parts of this workbook may
have been repaired or discarded"

Why I'm getting this message even in the simple workbook which contain only
one value in one cell?



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Copying Excel File Problem

Raja,
You mean that you are storing the Excel file as a BLOB in a database ?

If so, it would seems that you are creating corruption somewhere during the
read/write process.

NickHK

"Raja" wrote in message
...
Hello,

I'm trying to the following scenario in Excel2007:

1) Reading binary data for an Excel workbook file and saving these binary
data in Database
2) Reading the binary data from the database and saving it to a file by
using File.Write mehtod of .Net
3) When openning the file in Excel2007, i get the following message

"Excel
completed file level validation and repair. Some parts of this workbook

may
have been repaired or discarded"

Why I'm getting this message even in the simple workbook which contain

only
one value in one cell?





  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 70
Default Copying Excel File Problem

yes I'm storing the excel file(.xlsm) as a BLOB in a database, and here is my
code

Dim lStream As System.IO.FileStream = System.IO.File.OpenRead("myFile")
ReDim lByte(CInt(lStream.Length))
Call lStream.Read(lByte, 0, CInt(lStream.Length))
lFile = System.IO.File.Create("newFile")
Call lFile.Write(lByte, 0, lByte.Length)
Call lFile.Close()


"NickHK" wrote:

Raja,
You mean that you are storing the Excel file as a BLOB in a database ?

If so, it would seems that you are creating corruption somewhere during the
read/write process.

NickHK

"Raja" wrote in message
...
Hello,

I'm trying to the following scenario in Excel2007:

1) Reading binary data for an Excel workbook file and saving these binary
data in Database
2) Reading the binary data from the database and saving it to a file by
using File.Write mehtod of .Net
3) When openning the file in Excel2007, i get the following message

"Excel
completed file level validation and repair. Some parts of this workbook

may
have been repaired or discarded"

Why I'm getting this message even in the simple workbook which contain

only
one value in one cell?






  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Copying Excel File Problem

Raja,
I don't use .Net, so can't say if it is correct or not. However, are you
sure this is working with binary data, rather some text form, similar to FTP
transfer where you have a choice of modes.
This work in VB/VBA:

Private Sub CommandButton2_Click()
Dim arrByte() As Byte

Open "C:\Book2.xls" For Binary As #1
ReDim arrByte(LOF(1))
Get #1, , arrByte
Close #1

Open "C:\Out.xls" For Binary As #1
Put #1, , arrByte
Close #1

End Sub

Maybe asking in one of the .net groups or a group for your database would be
better, as this is not really an Excel matter.

NickHK

"Raja" wrote in message
...
yes I'm storing the excel file(.xlsm) as a BLOB in a database, and here is

my
code

Dim lStream As System.IO.FileStream = System.IO.File.OpenRead("myFile")
ReDim lByte(CInt(lStream.Length))
Call lStream.Read(lByte, 0, CInt(lStream.Length))
lFile = System.IO.File.Create("newFile")
Call lFile.Write(lByte, 0, lByte.Length)
Call lFile.Close()


"NickHK" wrote:

Raja,
You mean that you are storing the Excel file as a BLOB in a database ?

If so, it would seems that you are creating corruption somewhere during

the
read/write process.

NickHK

"Raja" wrote in message
...
Hello,

I'm trying to the following scenario in Excel2007:

1) Reading binary data for an Excel workbook file and saving these

binary
data in Database
2) Reading the binary data from the database and saving it to a file

by
using File.Write mehtod of .Net
3) When openning the file in Excel2007, i get the following message

"Excel
completed file level validation and repair. Some parts of this

workbook
may
have been repaired or discarded"

Why I'm getting this message even in the simple workbook which contain

only
one value in one cell?








  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 70
Default Copying Excel File Problem

Hi the .Net code is ok and works fine with Excel2003. the problem occurs only
in .xlsm file format which is added in Excel 2007

Regards,
Raja

"NickHK" wrote:

Raja,
I don't use .Net, so can't say if it is correct or not. However, are you
sure this is working with binary data, rather some text form, similar to FTP
transfer where you have a choice of modes.
This work in VB/VBA:

Private Sub CommandButton2_Click()
Dim arrByte() As Byte

Open "C:\Book2.xls" For Binary As #1
ReDim arrByte(LOF(1))
Get #1, , arrByte
Close #1

Open "C:\Out.xls" For Binary As #1
Put #1, , arrByte
Close #1

End Sub

Maybe asking in one of the .net groups or a group for your database would be
better, as this is not really an Excel matter.

NickHK

"Raja" wrote in message
...
yes I'm storing the excel file(.xlsm) as a BLOB in a database, and here is

my
code

Dim lStream As System.IO.FileStream = System.IO.File.OpenRead("myFile")
ReDim lByte(CInt(lStream.Length))
Call lStream.Read(lByte, 0, CInt(lStream.Length))
lFile = System.IO.File.Create("newFile")
Call lFile.Write(lByte, 0, lByte.Length)
Call lFile.Close()


"NickHK" wrote:

Raja,
You mean that you are storing the Excel file as a BLOB in a database ?

If so, it would seems that you are creating corruption somewhere during

the
read/write process.

NickHK

"Raja" wrote in message
...
Hello,

I'm trying to the following scenario in Excel2007:

1) Reading binary data for an Excel workbook file and saving these

binary
data in Database
2) Reading the binary data from the database and saving it to a file

by
using File.Write mehtod of .Net
3) When openning the file in Excel2007, i get the following message
"Excel
completed file level validation and repair. Some parts of this

workbook
may
have been repaired or discarded"

Why I'm getting this message even in the simple workbook which contain
only
one value in one cell?











  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 70
Default Copying Excel File Problem

I've tested the code you've written, and i got the same problem with
Excel2007 xlsm file format

Thanks,
Raja

"Raja" wrote:

Hi the .Net code is ok and works fine with Excel2003. the problem occurs only
in .xlsm file format which is added in Excel 2007

Regards,
Raja

"NickHK" wrote:

Raja,
I don't use .Net, so can't say if it is correct or not. However, are you
sure this is working with binary data, rather some text form, similar to FTP
transfer where you have a choice of modes.
This work in VB/VBA:

Private Sub CommandButton2_Click()
Dim arrByte() As Byte

Open "C:\Book2.xls" For Binary As #1
ReDim arrByte(LOF(1))
Get #1, , arrByte
Close #1

Open "C:\Out.xls" For Binary As #1
Put #1, , arrByte
Close #1

End Sub

Maybe asking in one of the .net groups or a group for your database would be
better, as this is not really an Excel matter.

NickHK

"Raja" wrote in message
...
yes I'm storing the excel file(.xlsm) as a BLOB in a database, and here is

my
code

Dim lStream As System.IO.FileStream = System.IO.File.OpenRead("myFile")
ReDim lByte(CInt(lStream.Length))
Call lStream.Read(lByte, 0, CInt(lStream.Length))
lFile = System.IO.File.Create("newFile")
Call lFile.Write(lByte, 0, lByte.Length)
Call lFile.Close()


"NickHK" wrote:

Raja,
You mean that you are storing the Excel file as a BLOB in a database ?

If so, it would seems that you are creating corruption somewhere during

the
read/write process.

NickHK

"Raja" wrote in message
...
Hello,

I'm trying to the following scenario in Excel2007:

1) Reading binary data for an Excel workbook file and saving these

binary
data in Database
2) Reading the binary data from the database and saving it to a file

by
using File.Write mehtod of .Net
3) When openning the file in Excel2007, i get the following message
"Excel
completed file level validation and repair. Some parts of this

workbook
may
have been repaired or discarded"

Why I'm getting this message even in the simple workbook which contain
only
one value in one cell?









  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 131
Default Copying Excel File Problem

It looks like you can use

ReDim lByte(lStream.Length - 1)


--
urkec


"Raja" wrote:

I've tested the code you've written, and i got the same problem with
Excel2007 xlsm file format

Thanks,
Raja

"Raja" wrote:

Hi the .Net code is ok and works fine with Excel2003. the problem occurs only
in .xlsm file format which is added in Excel 2007

Regards,
Raja

"NickHK" wrote:

Raja,
I don't use .Net, so can't say if it is correct or not. However, are you
sure this is working with binary data, rather some text form, similar to FTP
transfer where you have a choice of modes.
This work in VB/VBA:

Private Sub CommandButton2_Click()
Dim arrByte() As Byte

Open "C:\Book2.xls" For Binary As #1
ReDim arrByte(LOF(1))
Get #1, , arrByte
Close #1

Open "C:\Out.xls" For Binary As #1
Put #1, , arrByte
Close #1

End Sub

Maybe asking in one of the .net groups or a group for your database would be
better, as this is not really an Excel matter.

NickHK

"Raja" wrote in message
...
yes I'm storing the excel file(.xlsm) as a BLOB in a database, and here is
my
code

Dim lStream As System.IO.FileStream = System.IO.File.OpenRead("myFile")
ReDim lByte(CInt(lStream.Length))
Call lStream.Read(lByte, 0, CInt(lStream.Length))
lFile = System.IO.File.Create("newFile")
Call lFile.Write(lByte, 0, lByte.Length)
Call lFile.Close()


"NickHK" wrote:

Raja,
You mean that you are storing the Excel file as a BLOB in a database ?

If so, it would seems that you are creating corruption somewhere during
the
read/write process.

NickHK

"Raja" wrote in message
...
Hello,

I'm trying to the following scenario in Excel2007:

1) Reading binary data for an Excel workbook file and saving these
binary
data in Database
2) Reading the binary data from the database and saving it to a file
by
using File.Write mehtod of .Net
3) When openning the file in Excel2007, i get the following message
"Excel
completed file level validation and repair. Some parts of this
workbook
may
have been repaired or discarded"

Why I'm getting this message even in the simple workbook which contain
only
one value in one cell?









Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro problem after copying an Excel File Peter[_14_] Excel Discussion (Misc queries) 5 March 7th 10 11:52 AM
Problem copying a formula in Excel 2003 [email protected] Excel Discussion (Misc queries) 2 January 7th 07 11:30 AM
reading txt file and copying the lines in new excel file [email protected] Excel Programming 2 August 11th 06 07:20 PM
Problem copying a range to another file Bob Lehrer Excel Programming 5 March 20th 06 12:07 PM
problem copying excel wroksheets Paul Townley Excel Discussion (Misc queries) 1 April 6th 05 06:29 PM


All times are GMT +1. The time now is 07:23 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"