Excel OLE in VB - Vertical Scroll Bars and Multiple Worksheets

Posted on 2004-10-28
Last Modified: 2013-11-25
In the project I am currently working on, in VB 6, I am trying to add an Excel OLE object.  I can get the worksheet to come up but I don't see any scroll bars.  How do I get the scroll bars (vertical) to appearand work to allow the user to scroll through the worksheet?  Also, the users want a multiple page worksheet to appear. They want each page to be editable and then to print each and every worksheet.  I currently print a report using word9.  I want to get all of the Excel worksheets to print into this word9 document.  I am a novice programmer so all help, patience, and direction is greatly appreciated.
Question by:JamesGTX
    LVL 48

    Expert Comment

    LVL 48

    Expert Comment

    LVL 48

    Accepted Solution

    LVL 5

    Expert Comment

    You have a lot of reading to do there.  The key part (which is doubtless mentioned in many of the above links) is ...

             OLE1.DoVerb vbOLEUIActivate
             OLE1.SizeMode = 1

    Assuming your OLE object is called OLE1 then those two lines of code will activate the spreadsheet object and force it to resize nicely to the area of the form you have allocated it.

    Activation gets you scrollbars and the worksheet tabs.

    Activation also creates a menu (basically Excel's menu) so the users would have access to the standrad File Print method.

    Definitely worth reading through the links provided as there will be other things you'll need to know about OLE objects as you progress.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Suggested Solutions

    Title # Comments Views Activity
    Source of man or women figure in Text Box 7 63
    Problem to delete range 4 40
    Problem to adjust sheet 1 69 2008 2 32
    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…
    You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
    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 is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA.…

    884 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