Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Macro problem after copying an Excel File | Excel Discussion (Misc queries) | |||
Problem copying a formula in Excel 2003 | Excel Discussion (Misc queries) | |||
reading txt file and copying the lines in new excel file | Excel Programming | |||
Problem copying a range to another file | Excel Programming | |||
problem copying excel wroksheets | Excel Discussion (Misc queries) |