Solved

entering input from VB forms to excel

Posted on 1998-10-17
3
129 Views
Last Modified: 2010-04-30
When the user enters specific information onto my application I need that information to be sent to a specific cell in  Excel. How do I write the code fro this? I have been trying to find info on this type of problem for some time. I can get the worksheet to load and unload , even to print but I have no idea on the code to sent it to the required cell. Any answers?
0
Comment
Question by:okuda
  • 2
3 Comments
 
LVL 12

Accepted Solution

by:
mark2150 earned 50 total points
ID: 1440394
Use the SendKeys to position the cursor in Excel. Send an F5 followed by the cell address and <Enter>.

M

0
 

Author Comment

by:okuda
ID: 1440395
Could you please give me an example... I tried this but it continues to place the information into the first cell.
Here is the code that I am using. Could you tell me what I am doing wrong?

SendKeys "C:\MSOffice\YO Book Sheet.xls~"
DoEvents
 AppActivate retval
SendKeys Text1.Text
Text1.Text = ""
DoEvents
AppActivate retval
SendKeys "{F5}"
DoEvents
AppActivate retval
SendKeys "($D$4)"
DoEvents
AppActivate retval
SendKeys "{Enter}", True
DoEvents
End Sub
0
 
LVL 12

Expert Comment

by:mark2150
ID: 1440396
Leave off the parens & $'s on ($D$4) - feed as D4...

0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

919 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now