?
Solved

create and populate an Excel file using vb

Posted on 2004-11-05
6
Medium Priority
?
130 Views
Last Modified: 2010-05-02
I would like to create and populate an Excel file.

For example:
   How would I set row 5 to a height of 32.
   How would I change the name of sheet 1 to my sheet.

Is there a good book I could look at to address these questions and may more?
0
Comment
Question by:jc31415
  • 3
  • 2
6 Comments
 
LVL 81

Expert Comment

by:byundt
ID: 12511202
Hi jc31415,
Sub Test()
Rows(5).RowHeight = 32
Worksheets("Sheet 1").Name = "my Sheet"
End Sub


Cheers!

Brad
0
 
LVL 81

Expert Comment

by:byundt
ID: 12511246
jc31415,
John Walkenbach probably has the best book on Excel VBA for beginners through medium experience. Excel 2003 Power Programming with VBA is the latest version of it. http://j-walk.com/ss/books/index.htm

You ought to investigate the macro recorder. It's a great way to learn the syntax and objects that you need to work with. You access the macro recorder through the Tools...Macro...Record macro menu item. Once you launch the macro recorder, it watches the manual operations and writes VBA code that will execute them. It is then very desirable to edit the VBA code, because the macro recorder almost always includes lots of fluff. It is quite common to shrink a recorded macro by 80% through hand-editing--and the edited code will run much faster as well.
Brad
0
 

Author Comment

by:jc31415
ID: 12511417
I may have asked this question in the wrong place. I do not want to write a macro that is accessed through Tools.
I want to write OLE code that is external to Excel which creates and populates an Excel file.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 81

Expert Comment

by:byundt
ID: 12511572
jc31415,
I transferred your question to the Visual Basic TA. That should be a better place to get the right assistance.
byundt--Excel TA Page Editor
0
 
LVL 6

Accepted Solution

by:
Amritpal Singh earned 200 total points
ID: 12511792
have a look at the following link for full xample

http://www.it-faq.pl/data/misc1/EN-US/219/151.htm
0
 

Author Comment

by:jc31415
ID: 12513439

    That link was very helpfull. Are you aware of other example that make use of VB OLE commands? I am trying to get as complete a list of OLE commands as possible.
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

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

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
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…
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
Course of the Month13 days, 20 hours left to enroll

809 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