Solved

entering input from VB forms to excel

Posted on 1998-10-17
3
131 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

830 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