Results 1 to 8 of 8

Thread: Work on excel file from access vba

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Quote Originally Posted by roberto21 View Post
    ..., the code used to call the sub follows

    If NDescrizione = "Quote associative di rinnovo" Then
    Call AggiornaLibroSoci(Me.Tessera)
    End If
    ...
    OK, that answers my question. Thanks




    Another possibility:-
    If you can solve the problem of opening an Excel file with ACCESS, then we can arrange that a macro already inside the Excel file starts when the Excel file is opened.
    ( I am not sure how you would transfer the information .... (Me.Tessera)
    One possibility could be to put it in the Clipboard from ACCESS, then retrieve it from the Clipboard from Excel.
    I have done this putting in and retrieving from Excel. Possibly the coding is the same in ACCESS. I am not sure. )

    I do not know why you are experiencing problems in opening an Excel File from ACCESS.
    Here for example, it is suggested that it can be done: http://www.vbaexpress.com/kb/getarticle.php?kb_id=527 .

    Hopefully an ACCESS expert might have a better idea and can help you further
    Last edited by DocAElstein; 02-08-2020 at 02:31 PM.

  2. #2
    Junior Member
    Join Date
    Jan 2014
    Posts
    6
    Rep Power
    0
    I found the solution to the problem of excel opening in read only mode. It was obvious, as are many solutions AFTER you have found them. It was also written in my first post: the table is linked to the access app, therefore the workbook is to be considered open. When I try to open it again with workbooks.open, excel can only open it in read-only mode. One may complain "why didn't excel say so, that the file was already open"? This I don't know, and would like to know.
    Anyhow, I replaced

    DoCmd.TransferSpreadsheet acLink,...
    with
    DoCmd.TransferSpreadsheet acImport, ...

    and now the .xlsm file opens correctly in read/write. Thank you everybody for your attention and interest. Now, if I or you could find the reason why xlValues is not recognized by the compiler, even though
    it is correctly listed in the object browser...

Similar Threads

  1. Replies: 6
    Last Post: 09-03-2019, 10:26 AM
  2. Unable to import excel file in Access 2007
    By excel_1317 in forum Access Help
    Replies: 9
    Last Post: 09-23-2013, 07:52 AM
  3. Run SQL In MS-Access From Excel VBA
    By bobdole22 in forum Excel Help
    Replies: 4
    Last Post: 09-12-2013, 01:35 AM
  4. Replies: 1
    Last Post: 03-07-2013, 11:42 AM
  5. Replies: 3
    Last Post: 12-20-2012, 11:10 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •