473,395 Members | 1,763 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

How to embed the Excel file in VB.NET 2005 Resources

Hi all,

Does anyone know how to embed the Excel file in VB.NET 2005 Resources?

Here is what I am doing at the moment:
1) In my VB.NET 2005 project code I load the excel with it path into string
as:
------------------------------------------------------------------------------------------------
Dim fileNameXL As String = "_MYEXCEL_REPORTS.XLS"
Dim pathNameXL As String = "\EXCEL_TEMP\"
Dim fullPathXL As String
fullPathXL = Path.GetFullPath(System.Windows.Forms.Application. StartupPath &
"\..")
fullPathXL = fullPathXL & pathNameXL
myExcelLocation = fullPathXL & fileNameXL
------------------------------------------------------------------------------------------------


2) Then I open the my excel file as:
------------------------------------------------------------------------------------------------
oWB = oXL.Workbooks.Open(FileName:=myExcelLocation, UpdateLinks:=False,
ReadOnly:=False)
------------------------------------------------------------------------------------------------
3) After analysing my data I simply insert into DataTable and run the data
table to created string file then I copy the string file into my
pre-formatted excel file as:
------------------------------------------------------------------------------------------------
With oSheet.Range("A6")
.Select()
.PasteSpecial(Excel.XlPasteType.xlPasteAll)
End With
------------------------------------------------------------------------------------------------

4) And save my excel file in different name under the C drive as:
------------------------------------------------------------------------------------------------
FileName = FolderName & "\" & FolderDate & "_YKY_RISK_REPORT.XLS"
oWB.SaveAs(FileName)
------------------------------------------------------------------------------------------------
Now instead of loading my pre-formated "_MYEXCEL_REPORTS.XLS" file everytime
I run the application I want to save this file into my application resources
so I can open from there do mu job and save it into user C dreive.

Why do I need this?
First reason is that user cannot delete accidentaly the _MYEXCEL_REPORTS.XLS
file
or nor they can cahange the format of the my excel file.

The reason I didn't wnat to create Excel file from scratch is to save time
because daily I will have to make 2-3 small application regading for the
reports and each application runs only upto 3 to 6 months. then when bussines
logic is chanage so the report layout will chanage plus we have more than 50
user that can use this app to generate report for different customer in daily
basis.

So I thought with VB.NET 2005 I can create a Excel file that I will deaisgn
the layout quickly the I can embed into my VB.NET 2005 application resources
quickly get the data from AS400 analysed it and open this excel file that is
in resources past the values and write into C drive as excel file but under
different name.

Does anyone knows any good article or example project so I can save much
more time and secure my application?

Thank you for reading my post.

Rgds,
GC

Feb 19 '07 #1
0 3918

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Pawel | last post by:
Hello All I tried to embed Excel sheet into HTML page by following command: <iframe src="Tmp.XLS" width="100%" height="500"></iframe> and it works, showing Excel sheet inside the page, but...
1
by: snicks | last post by:
I have a series of XLS files which I need to embed into a PowerPoint presentation on an IIS server. I’ll be using VB.NET. I’ve tried using an ASPOSE.PowerPoint control to do this and it does...
4
by: zhangyl | last post by:
I want to embed the excel worksheet into my application and use it like datagrid, if somebody can tell a solution, whether visual studio 2005 can do it ? thanks.
4
by: David | last post by:
I have an application that creates a database from a text file of DDL (generated by Visio). Currently I have to deploy the text file with my application and open it using the statement: SQL =...
13
by: Lloyd Dupont | last post by:
In the good old days I believe people were using the arcane technology which came to be known as COM+ to embed other application's document in their own document. Like a Word with document a...
1
by: Joe | last post by:
Hi I am trying to run a bat files using AL.exe and have 1 question I can run the exe this way - all is fine "C:\WINNT\Microsoft.NET\Framework\v2.0.50727\al.exe" /t:lib /culture:es-ES...
2
by: Joe | last post by:
Hi I am able to embed Excel into a WebBrowser on my Dev machine but on a client machine an instance of Excel starts in it's own window outside of my form. I have used the WebBrowser with VS 2005...
2
by: Thomas | last post by:
It sounds a piece of cake but It is surprisingly frustrating to do. I have a winform which receives data from database and present them as Excel chart and spreadsheet. It is required by the client....
8
by: CodeLeon | last post by:
Hi, All. I am creating a setup program. The way it works is that the user creates their setup info, my program generates the C# code for a setup executable, embeds the xml file containing the info...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.