Feb 25th, 2006, 02:42 PM
#1
Thread Starter
Junior Member
Using a excel sheet in a form
Hi.
I want to use an excel sheet in a form and read the edited values in the sheet.
First I inserted an "insertable object" Microsoft Excel Woksheet. However i can't access the values that the custumer puts in my sheet. I want to use something like:
Var1=Sheet.Cells(1,1)
It's that possible?
Anyone have any trick?
Thanks in advance!
Feb 25th, 2006, 03:22 PM
#2
Re: Using a excel sheet in a form
I'm guessing it might be easier to use a flexgrid and just read and write values back and forth from Excel.
Feb 25th, 2006, 03:35 PM
#3
Thread Starter
Junior Member
Re: Using a excel sheet in a form
I can't easaly edit, delete or insert rows, with flex grid...
Feb 25th, 2006, 03:39 PM
#4
Re: Using a excel sheet in a form
I've actually never tried this before, but I'm guessing that you would have to somehow get a reference to the Excel sheet and then use the Excel object model to interact with it. Can you post some more code or the project files?
Feb 25th, 2006, 04:32 PM
#5
Thread Starter
Junior Member
Re: Using a excel sheet in a form
I don't have any code! I just put a shet in my form and now I want to find a way to get and put values and text in that sheet...
Feb 26th, 2006, 06:14 PM
#6
Thread Starter
Junior Member
Re: Using a excel sheet in a form
I'm tired! I try many things without sucess!
Any trick?
Feb 26th, 2006, 07:19 PM
#7
Re: Using a excel sheet in a form
What version of Excel do you have? You can access a particualr cell like you posted using the Excel Object Model or you can show a sheet on a form using the OLE control.
to automate Excel...
VB Code:
Option Explicit
'Add a reference to ms excel xx.0 object library
Private sub command1_click()
dim oapp as excel.application
dim owb as excel.workbook
set oapp = new excel.application
set owb = oapp.workbooks.open("C:\MyFile.xls")
owb.sheets("sheet1").Cells(1,1) = "Test"
msgbox owb.sheets("sheet1").Cells(1,1)
owb.save
owb.close
set owb = nothing
oapp.quit
set oapp = nothing
End Sub
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
Feb 28th, 2006, 08:36 AM
#8
Thread Starter
Junior Member
Re: Using a excel sheet in a form
I want to put a excel worksheet in my form.Is that possible with OLE. But I can't access it!
How can I do it?
Feb 28th, 2006, 08:40 AM
#9
Re: Using a excel sheet in a form
Put an OLE control on your form (OLE controls are found on your Toolbar) and link it to your spreadsheet.
Feb 28th, 2006, 09:57 AM
#10
Re: Using a excel sheet in a form
The OLE link should be either Linked or Embedded, only two choices. Once on your form, click on it to activate/Edit, etc. during run time.
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
Feb 28th, 2006, 02:23 PM
#11
Thread Starter
Junior Member
Re: Using a excel sheet in a form
And, with a embebed sheet, how can I access, for example, at the cell(1,1)?
Feb 28th, 2006, 02:28 PM
#12
Re: Using a excel sheet in a form
AFAIK, you would have to invoke the double left clicking to create an instance of the embedded workbook first. I really dont get the reason you would want to show the workbook on a form embedded if you need to manipulate it programmatically?
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
Feb 28th, 2006, 07:30 PM
#13
Thread Starter
Junior Member
Re: Using a excel sheet in a form
I need a table where the custumer can easaly edit, insert and remove rows. My idea is use a excel worksheet to do it.
Sep 13th, 2007, 06:04 PM
#14
Re: Using a excel sheet in a form
Warning: Thread Resurrection.
Did this ever get resolved? I need to do this too. I need to embed an Excel-like sheet into a Form and access it programatically.
Thanks!
Dave
Nobody knows what software they want until after you've delivered what they originally asked for.
Don't solve problems which don't exist.
"If I had eight hours to cut down a tree, I'd spend six hours sharpening my axe." --- Abraham Lincoln (1809-1865)
2 idiots don't make a genius.
Sep 14th, 2007, 04:02 PM
#15
Re: Using a excel sheet in a form
Sup Dave. You can use an Insertable Object called the "Microsoft Office Excel Worksheet". Its very similar to OLE but much better and updated.
Attached Images
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
Sep 14th, 2007, 04:16 PM
#16
Re: Using a excel sheet in a form
Right on, bro! Any idea how similar this interface is to the regular WorkSheet Object? Any docs on the subject?
Originally Posted by
RobDog888
Sup Dave. You can use an Insertable Object called the "Microsoft Office Excel Worksheet". Its very similar to OLE but much better and updated.
Nobody knows what software they want until after you've delivered what they originally asked for.
Don't solve problems which don't exist.
"If I had eight hours to cut down a tree, I'd spend six hours sharpening my axe." --- Abraham Lincoln (1809-1865)
2 idiots don't make a genius.
Sep 14th, 2007, 05:12 PM
#17
Re: Using a excel sheet in a form
So is there a way to access the Object programatically? Like can I get a Range out of it at run-time?
Nobody knows what software they want until after you've delivered what they originally asked for.
Don't solve problems which don't exist.
"If I had eight hours to cut down a tree, I'd spend six hours sharpening my axe." --- Abraham Lincoln (1809-1865)
2 idiots don't make a genius.
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