Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

How do I open an Excel 2000 sheet in VB6 that is connected to access through a datasource?

Posted on 2004-08-19
5
Medium Priority
?
358 Views
Last Modified: 2010-05-02
How do I open an Excel 2000 sheet in VB6 that is connected to access through a datasource without the datasource residing on that particular computer?I need to have this sheet open refresh all datasources and then print to several printers?  I can't get it to work unless I create datasources on each computer.  
0
Comment
Question by:sjmmajor
  • 3
  • 2
5 Comments
 
LVL 5

Expert Comment

by:jmacmicking
ID: 11843157
Use a file datasource instead of a system or user datasource.  That way you can store the file for the datasource in a common location (a network drive for instance) and set the Excel sheet to reference it there.
0
 

Author Comment

by:sjmmajor
ID: 11845425
Does the worksheet have to reside on each computer?  I have tried to connect a worksheet on a network drive but it doesn't update when I run it unless I detach and attach the link again.  Any better ways of doing this?
0
 

Author Comment

by:sjmmajor
ID: 11845496
Also, sometimes I am getting a binding error.
0
 
LVL 5

Accepted Solution

by:
jmacmicking earned 500 total points
ID: 11852651
The worksheet should be able to reside on a network drive with no trouble.  If you're not %100 sure everyone will have the same drive mapped to the same drive letter make sure you use the UNC path (\\servername\sharename\path).
If you can include the binding error it may help.  A few other tips;  change the Refresh control to disable background refresh (that way you don't get stall data while the refresh is occuring) and to refresh the data on file open.  To do this in Excel 2000 follow these steps:
  Open the workbook in Excel.
  Select one of the cells in the data range
  Open the Data menu
  Highlight Import External Data
  Click Data Range Properties (if this is greyed out make sure you've selected a cell in the data range)
  Turn off Enable background refresh
  Turn on Refresh data on file open
 
If you need help using the Excel object model to open and print the database let me know; I can post pseudo-code to get you started.
0
 

Author Comment

by:sjmmajor
ID: 11897466
Thanks.  I changed the datasources to file datasources on the server and used the UNC path as well as refresh the data.  It works!!
0

Featured Post

Independent Software Vendors: 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!

Question has a verified solution.

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

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
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

963 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