Excel automation to access a workbook

I want to utililze Excel Automation to obtain properties from an Excel 
workbook.

Given path of the Excel workbook, how can I get the properties of a workbook 
without making the Excel application or the workbook visible.

Then obviously close the Excel workbook and the Excel Object after I get the 
properties

Any help with this would be appreciated
0
Utf
12/15/2007 1:51:00 PM
access.formscoding 7493 articles. 0 followers. Follow

1 Replies
775 Views

Similar Articles

[PageSpeed] 16

Here is some code I am using. I need help getting it to work. When I run it, 
I get an error message

"Run-time error '-2147417851 (80010105)'  Method 'Open' of object 
'Workbooks' failed"

I am in a form in Access 97 trying to access Excel 97 through automation. OS 
Win XP
In the current database i have set a references to 
Microsoft Excel 8.0 Objct Library
Microsoft Officel 8.0 Objct Library


Sub AccessWorkbook()
    Dim xlApp As Excel.application
    Dim xlwbBook As Excel.Workbook
    Dim stFile As String

    stFile = "C:\New Files\Data.xls"

     'Instantiate a new session with the COM-Object Excel.exe
    Set xlApp = New Excel.application
     
    Set xlwbBook = xlApp.Workbooks.Open(stFile)
    
  MsgBox xlwbBook.Names(1).Name
     
     'Close Excel.
    xlApp.Quit
     
     'Release the COM-objects from memory.

    Set xlwbBook = Nothing
    Set xlApp = Nothing
     

End Sub
0
Utf
12/15/2007 3:06:00 PM
Reply:

Similar Artilces:

Access 2007
i find the file size of Access 2007 expanding quickly, different from previous version. i need to compact it frequently. is it normal? Secondly, i also find when i compact the database in Access 2007, the file name and its extension (accdb) will change to database.mdb thanks a lot. tony More info 1. The file only stored forms & queries & reports 2. compact in local drive, the filename will not be renamed. The rename only happens in network drive. so strange. any comments? thx. "Tony WONG" <x34@hknet.com> ���g��l��s�D:OY2sYLv4HHA.3400@TK2MSFTNGP03.p...

Refresh Excel file
After refreshing an Excel file, does the record stay at the one you were working on or does it go back to the first record of the file? This doesn't seem like an Excel question. Maybe you could explain what you're trying to do. -- Jim Rech Excel MVP "excel dummy" <excel dummy@discussions.microsoft.com> wrote in message news:D3007EE5-7CC7-45F7-B6E0-BCAB71199012@microsoft.com... | After refreshing an Excel file, does the record stay at the one you were | working on or does it go back to the first record of the file? ...

Converting access report to pdf format
hi I wrote a database that, among other things, prints a variety of reports for my clients. Once each report is done, I run a program called pdfWriter to convert each report to a pdf file. (When this program is installed, I select the printer called pdfWriter then print the file. It doesn't actually print a physical copy but saves the file in pdf format.) Then I e-mail these pdf reports to the clients. What I'm looking for are ways that I could automate this process from Access. Can this be done? If so, could someone point me in the right direction. Any clues would be grea...

Access 07 much slower than 2000/2003, multi user
three new PC withh access 2007 trial and an exsiting access 2000 mdb on a network share. Performance is slower but acceptable OK with one user, with additin users (up to 3) it becomes very slow. record scrolling is slow but the main problem is adding records. When typing in the edit boxes it can take > 1 sec for the text to appear, same database saved in 2002/3 format works with any delay in typing or scrolling. Office 07 SP1 installed, and previous versions of the office removed when testing 07. Did same tests with linked tables to sql2005, same results. ...

How do I link Excel pages to a different master Excel workbook?
I am trying to take part lists from different assemblies and link them to a master part list. Ideally one sheet from the assembly part lists will have many pages and be linked to a sheet in the master part list with the name of that specific assembly. I am operating on Midrosoft Office Version 2003. open both the master and your part list on your master if you set a cell to (="name of part list book"!A1) you can do that by clicking any cell on the other workbook with them both open its just like a formula on the sheet only instead it has the workbooks name first i hope thi...

Graphing in Excel
Does anyone know any good graphing tutorials for excel??? I am havin difficulty graphing a dual line graph. I don't know the problem origin. Any help would be tremendous -- Mrinkli ----------------------------------------------------------------------- Mrinklin's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=2536 View this thread: http://www.excelforum.com/showthread.php?threadid=38935 M, Get familiar with internet searches (like www.google.com). It's a good resource. A search for "excel chart tutorial" (w/o quotes) would find Jon Pel...

tangent excel question
this isnt necessarily an excel question, but it is related in that i affects a spreadsheet im working on. ive been looking for a centerline symbol, but none of the fonts i hav installed seem to include this symbol. it is a blueprint / surveyin symbol that has a L superimposed by a c. i am using CL right now bu would like to use the actual symbol for aesthetics. is there a way i can make a custom symbol or does anyone know where can find a font that would include such a symbol? thank you. i lov excel. ^_ -- lsu-i-lik ---------------------------------------------------------------------...

Excel 2007 Pivot Tables
1. How can I create a Pivot Table from a text file, downloaded from a mainframe database? I have been told this could be done in previous versions of Excel. 2. If I get a new text file each day, how can I refresh the existing Pivot Table, without the necessity of recreating Thank you very much Marsh Import the Text file into Excel. -- Regards Dave Hawley www.ozgrid.com "Marsh" <Marsh@discussions.microsoft.com> wrote in message news:1C480551-AE4D-4E31-B6DC-DF527E532091@microsoft.com... > 1. How can I create a Pivot Table from a text file, downlo...

Have free download for Excel for viewing files only.
I have received a file in an email and I cannot view it because I don't have Excel. PowerPoint has a free download so that you can view a presentation. If Excel had this same option, people would be able to view a spreadsheet sent to them for free. If that person wanted to make any changes to the file, THEN they would need to purchase Excel. You can download XL viewer from here http://www.microsoft.com/downloads/details.aspx?FamilyID=4EB83149-91DA-4110-8595-4A960D3E1C7C&displaylang=EN Watch for text wrap, Regards, "CJPrevette" <CJPrevette@discussions.microsoft.co...

Creating form Letters from an excel spreadsheet
Hi I seem to be having great difficulty creating for letters in word and linking them to an excel spreadsheet. It keeps telling me it needs to be in table form???? I thought any data in excel was a table????? Help me please!!!! Hi if you're looking for mail merger instructions you may have a look at http://www.mvps.org/dmcritchie/excel/mailmerg.htm -- Regards Frank Kabel Frankfurt, Germany Jeff wrote: > Hi I seem to be having great difficulty creating for > letters in word and linking them to an excel spreadsheet. > It keeps telling me it needs to be in table form???? &...

Bar chart with a Percentage
I have a bar chart that has 4 vertical bars. On the 2nd and 4th bar I'd like to list the percentage it is of the 1st and 3rd bar, respectively. I already have labeled each bar with its numerical value and data name. Can I do this? If so, how? I've tried for about 2 hours now. Thanks in advance for any help! >-----Original Message----- >I have a bar chart that has 4 vertical bars. On the 2nd >and 4th bar I'd like to list the percentage it is of the >1st and 3rd bar, respectively. I already have labeled >each bar with its numerical value and data name....

Excel 2003 #4
Hope someone out there can help, I have lost the toolbars and menu bars in Excel, at first I thought it was showing full screen but it wasn't I then tried to Alt/V to bring up the view menu but again nothing. Have re-installed Excel but still not showing, can anyone help me with this please. And you're sure that the window isn't just too far up and off the visible viewing area--so all that you would need to do is resize that window? If you can see excel's application title bar, then this isn't the problem. If you want to reset all the toolbars back to factory default...

Accessing Excel pages using VB
Hi. I'm wondering if any of you can help me with a problem I'm having. It's likely a trivial answer, but I'm not seeing it at the moment. I'm using VB 6.0 and Excel 2002. I have an Excel workbook that has information about days of the month -- each day having an individual spreadsheet 'Day (1)', 'Day (2)', etc. as tabs along the bottom of the workbook. I want to be able to access information from individual "days" using a VB application and do some processing and then printing of the data in VB. First of all, when addressing data on spre...

Excel Function VLOOKUP
Hi, I'm having trouble looking up a table of "Names". The table deifene below is called ROL_IS and list hundred of other defined tables. Error where: =VLOOKUP(A33,VLOOKUP(CUR_MON,ROL_IS,3,FALSE),2,FALSE) but no errors where =VLOOKUP(A33,ACT_IS,2,FALSE) or =VLOOKUP(CUR_MON,ROL_IS,3,FALSE) ANS: ACT_IS The array function in VLOOKUP appears not to converting formula to NAME. If anyone knows or needs further details if would be appreciated. Thanks Elizabet -- Message posted from http://www.ExcelForum.com If I understand you correctly =VLOOKUP(A33,INDIRECT(VLOOKU...

Change the default color Excel 2007 uses to highlight selected cel
I'm using Excel 2007 and I'd like to change the default color Excel 2007 uses to highlight the selected cells in a worksheet. When selecting a range (ex. A1:D10). The selected range takes on a light transparent blue. Very hard to see when working in selected range. I've tried changing Office>Excel Options>Popular>Color Scheme - 3 colors to choose from (Blue, Silver, Black). This doesn't make a difference with the selection color at all. Also tried to change the Personalization>Appearance>Different Color Schemes with the Advanced option>Item areas, thi...

Access Runtime 2007 with Windows 7 Crashing
I am setting up new Dell Windows 7, 64 bit machines and have installed Access Runtime 2007 which keeps crashing. Windows is telling me that the solution is this update: KB957262 http://www.microsoft.com/downloads/details.aspx?FamilyId=6F4EDEED-D83F-4C31-AE67-458AE365D420&displaylang=en but the update wont install. The info I have gathered from is that this update fails with this error code because it cant find access. Is there a way to force this update to fix the problem without installing a full copy of access? If not my work around is to install Access Runtime 2003 along w...

Distorted Print Preview in Excel 2007
All of the sudden Print Preview and printing is distorted as compared to the chart as displayed during design. Verticle grid lines are missing and the horizontal axis appears to be log. ...

how do i display the sort arrows in column headers in access 2007
I can't seem to find where I can turn on the sort arrows in table column headers. Any advice? Where are the column headers? In a table, query, form - data sheet - other? Some where else? Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia "KenBob2" <KenBob2@discussions.microsoft.com> wrote in message news:5280AF5F-F673-48D4-8C31-0051BF53A3F4@microsoft.com... >I can't seem to find where I can turn on the sort arrows in table column > headers. Any advice? I think it's: - office button (that upper left button) - access o...

Web form that drops into access database
I want to do something that I feel is very simple; however, I have no knowledge of how to do it. I want to have a form on a website that drops the data from the form into an access database. I have a decent amount of experience with web design, and would just like somewhere to start. Any help would be greatly appreciated. Thanks, Michael <mgreer65@gmail.com> wrote in message news:e6a7c688-272b-4219-8241-74c3e3e7b2a2@e25g2000prg.googlegroups.com... >I want to do something that I feel is very simple; however, I have no > knowledge of how to do it. I want to have a form on a w...

Changing how Excel INTERPRETS dates
Anybody know how to change the way Excel interprets dates? For the lif of me I can't remember. I don't just mean reformatting a cell. I mean if one would typ "8/11/04" Excel would read this as November 08, 2004 and not August 11 2004. Any hope would be much appreciated, Dav -- dgreenfiel ----------------------------------------------------------------------- dgreenfield's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=1629 View this thread: http://www.excelforum.com/showthread.php?threadid=27689 Hi this is defined in your Windows - Region...

How to restrict printing access for users
Hello, I am new to shared databases and was wondering if there was a way to restirct users from printing specific reports? Thanks. You can use User-Level security: Security FAQ http://support.microsoft.com/download/support/mslfiles/SECFAQ.EXE Lynn Trapp's summarization: http://www.ltcomputerdesigns.com/The10Steps.htm KB articles: http://support.microsoft.com/default.aspx?scid=KB;en-us;q165009 http://download.microsoft.com/download/access97/faq1/1/win98/en-us/secfaq.exe http://support.microsoft.com/default.aspx?kbid=325261 Joan Wild's articles: http://www.jmwild.com/security02....

Need to import contacts but only allow certain groups access
Hi, Just wondering what the best practice is for storing external contacts I've imported, that I only want certain groups to be able to access. I guess I could create a public folder, but since these are slowly being withdrawn, maybe not? I'm currently considering adding the contacts to a particular OU, then creating an address book which filters for a property set on the contacts. I'd then propose setting the appropriate NTFS permissions on those contacts. Any suggestions appreciated. > I'm currently considering adding the contacts to a particular OU, then > c...

Excel macro deployment
Hi I have been deploying Excel macro to workstations using an MSI. The MSI creates a folder under program folders and drops the xla files in the folder. The installer also sets a registry value. When the user opens Excel, the macros begin. This works fine for Excel 2003. What do I need to do to properly install Macros under Excel 2007 and Excel 2010? Thanks ...

Importing to access from excel
I understand that access uses the first 15 rows of an imported excel sheet to determine whether the access field is numerical or text. I have a worksheet with a date column, and columns that contain both numbers and text entries (in the form of less than values e.g.<1). Therefore the date column cannot be changed to text or number otherwise it looses the correct format. And although the numbers can be changed to text in excel they are only recognised as numbers in access. The only way I have found to get the all the information across from excel into access without error values (e...

Excel Formula 02-06-10
I Need a Formula which can tell me eg. on seperate wotksheet a report of which product is chipset and from which suppliers.Thanks for any help I get. A B C 1 Product 1 Supplier 2 £10.00 2 Product 2 Supplier 1 £8.00 3 Product 3 Supplier 2 £8.00 4 Product 2 Supplier 2 £6.00 5 Product 1 Supplier 2 £11.00 6 Product 3 Supplier 1 £7.00 Farid, I think you mean:- cheapest - and not chipset. "Farid" wrote: > I Need a Formula which can tell me eg. on seperate wotksheet a report of > which product is chipset and from which ...