Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Writing Data in Excel format

Posted on 1999-07-22
2
Medium Priority
?
167 Views
Last Modified: 2010-04-30
Hi, I have some data that I'd like to write in an Excel spreadsheet directly from my VB program.

Can somebody give me some sample code to add the text in a cell for example?

Thanks
0
Comment
Question by:mikemonnex
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 1

Expert Comment

by:Jaysin28
ID: 1526684
No expert will provide an answer if you post this Q, one more time.  This is unprofessional behavior and unlikely to get the response you are looking for.


0
 
LVL 5

Accepted Solution

by:
mayhew earned 400 total points
ID: 1526685
Dim app As Excel.Application
     
'Create instance of Excel object.
Set app = New Excel.Application
     
'Make app visible so you can see what happens.
app.Application.Visible = True

'Open an existing workbook.
app.Workbooks.Open app.Path & "\" & "MyWorkbook.xls"

'Select a sheet.
app.Application.Sheets("Daily").Select

'Select a cell.
app.Application.Range("C11").Select

'Enter some data.
app.Application.ActiveCell.Value = "Whatever you want."

'Save the workbook.
app.Application.Workbooks(1).Save

'Or save as a different workbook.
app.Application.Workbooks(1).SaveAs

'Close the workbook.
app.Application.Workbooks(1).Close

'Close the app.
app.Application.Quit
Set app = Nothing




0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

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…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

671 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