|
-
Jul 8th, 2008, 02:28 PM
#1
Thread Starter
Hyperactive Member
[RESOLVED] [2008] Include xls File in Project
Is it possible to include an excel file in your project, and make reference to it in your code without having the actual file on the computer that the program is running on?
-
Jul 8th, 2008, 03:20 PM
#2
Re: [2008] Include xls File in Project
You could reference it the same way you would reference any embedded resource. But are you needing to save changes or ??? with it?
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Jul 8th, 2008, 03:36 PM
#3
Lively Member
Re: [2008] Include xls File in Project
I use an excel file in one of my programs....but I launch Excel to interact with it. Here are some sample lines of code I used:
Schedule = CreateObject("Excel.Application")
Schedule.Workbooks.Open(schedfilpath)
...........
row = row + 1
.Range("A" & Format$(row)).Select()
Acell = (.ActiveCell.FormulaR1C1)
...........
Schedule.workbooks.close()
KillExcel()
Schedule = Nothing
Schedule.release()
requires: Interop.Excel.dll
as a reference. Hope this helps.
oh ya:
Private Sub KillExcel()
Dim myProcesses() As Process
Dim myProcess As Process
On Error Resume Next
myProcesses = Process.GetProcessesByName("EXCEL")
For Each myProcess In myProcesses
myProcess.Kill()
Next
On Error GoTo 0
myProcesses = Nothing
myProcess = Nothing
end sub
Last edited by cageybee; Jul 8th, 2008 at 03:47 PM.
-
Jul 9th, 2008, 07:11 AM
#4
Thread Starter
Hyperactive Member
Re: [2008] Include xls File in Project
 Originally Posted by cageybee
I use an excel file in one of my programs....but I launch Excel to interact with it. Here are some sample lines of code I used:
Well ya I do that too, I'm just wondering if I can do it with an Excel file from within my project.
 Originally Posted by RobDog888
You could reference it the same way you would reference any embedded resource. But are you needing to save changes or ??? with it?
How do you make that reference robdog? I'm sorry, this is really the first program I've written in .NET. I am needing to save changes..I take it you can't do that if you use it as a resource? What is "??? with it?" lol
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|