|
-
Jun 3rd, 2005, 01:53 PM
#1
Thread Starter
Member
Accessing an excel sheet remotely
VB studs,
I want to write VBA code that will open an excel sheet chose an entry of the list created on this sheet and also click a button on this sheet. Should be easy, but I can't figure it out.
Thanks in Advance,
VO
-
Jun 3rd, 2005, 04:46 PM
#2
Fanatic Member
Re: Accessing an excel sheet remotely
What so you have so far, post your code.
"I have not failed. I've just found 10,000 ways that won't work."
'Thomas Edison'
"If we knew what it was we were doing it wouldn't be called research, would it?"
'Albert Einstein'
VB6
-
Jun 6th, 2005, 09:22 AM
#3
Thread Starter
Member
Re: Accessing an excel sheet remotely
I have no code right now, but I think it should be something like this...
VB Code:
Dim oApp As Excel.Application
Dim oWB As Excel.Workbook
Dim Sheet As Excel.Worksheet
Dim i As Integer
Set oApp = CreateObject("Excel.Application")
oApp.Visible = True
Set Sheet = oWB.Sheets(1)
'Choose the 1st entry in the listbox
sheet.listbox.Selected(1) = True
'Run a sub routine on the other sheet
sheet.subrountine arguments
-
Jun 6th, 2005, 11:30 AM
#4
Re: Accessing an excel sheet remotely
You say you want to write VBA code but It sounds like your needing this in VB6?
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 
-
Jun 6th, 2005, 11:44 AM
#5
Thread Starter
Member
Re: Accessing an excel sheet remotely
Either way is fine... Is it different in VBA that it is in VB6?
Thanks,
VO
Either way is fine... Is it different in VBA that it is in VB6?
Thanks,
VO
-
Jun 6th, 2005, 11:46 AM
#6
Re: Accessing an excel sheet remotely
o.0...is that a new form of double post?
-
Jun 6th, 2005, 12:06 PM
#7
Re: Accessing an excel sheet remotely
This should get you started in Automating Excel from VB6.
VB Code:
Option Explicit
'Add a reference to MS Excel xx.0 Object Library
Private moApp As Excel.Application
Private Sub FormLOad()
set moapp = New Excel.Application
End Sub
Private Sub Command1_Click()
Dim oWB As Excel.WorkBook
Set oWB = moApp.Workbooks.Open("C:\Test.xls")
moApp.Visible = True
oWB.Sheets(1).Select
MsgBox oWB.Sheets(1).Cells(1, 1).Value
oWB.Close
Set oWB = Nothing
moApp.Visible = False
End Sub
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
If TypeName(moApp) <> "Nothing" Then
moApp.Quit
End If
Set moApp = 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 
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
|