|
-
Jan 12th, 2000, 06:11 PM
#1
Thread Starter
Hyperactive Member
I'm using VB6 and Excel
I've got an Excel spreadsheet already created and I want to send information to certain cells.
Does anyone have an example on how to do this.
------------------
Thanks in advance for any help provided.
-
Jan 12th, 2000, 09:42 PM
#2
New Member
I'm stuck on this to cannot find anything on the web....is it possible??
-
Jan 12th, 2000, 09:52 PM
#3
Hyperactive Member
It is possible. I had the same problem, the help files in VB and Excel didn't help until I looked at both and cross-referenced them and guessed a bit. I'm in the middle of something but when I get a chance I will see if I can my code doing it.
Basically, you need to make an Excel object, use it to open the file and then just do things with the properties etc. It may take me a bit, gotta finish some stuff first.
Quick example doing it in Access's VBA, opening a Word Document.
Dim WordDoc As Object
Set WordDoc = CreateObject("word.application")
WordDoc.Application.Visible = True
WordDoc.Application.Documents.Open strFileName
WordDoc.Application.windowstate = 1
Basically it's the same but using and Excel object and OpenObject or similar. Hope this gets you started in the right direction. Let me know if you need more or if this helped enough.
[email protected]
[This message has been edited by netSurfer (edited 01-13-2000).]
-
Jan 13th, 2000, 12:17 PM
#4
Thread Starter
Hyperactive Member
Thanks people, I've found the answer, so if you want I'll post it for you. Or you can email me and I'll send it
------------------
Thanks in advance for any help provided.
-
Jan 13th, 2000, 12:30 PM
#5
Hyperactive Member
-
Jan 13th, 2000, 05:28 PM
#6
Thread Starter
Hyperactive Member
Right here is the basic information:
Private tmpWorkbook As Excel.Workbook
Private tmpWorkSheet As Excel.Worksheet
Private Sub cmdExport_Click()
Dim fname As String
fname = "c:\my documents\test.xls"
Set tmpWorkbook = GetObject(fname)
tmpWorkbook.Sheets("Sheet 1").Select
Set tmpWorkSheet = tmpWorkbook.ActiveSheet
With tmpWorkSheet
.Cells(7,3)="Testing"
End With
End Sub
Hope this helps.
------------------
Thanks in advance for any help provided.
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
|