+ Reply to Thread
Results 1 to 2 of 2

Editing Existing Excel File, Without Opening Excel

  1. #1
    Registered User
    Join Date
    04-26-2013
    Location
    USA
    MS-Off Ver
    Microsoft 365 Apps for Business (v 2306 / 16.0) 64-bit
    Posts
    27

    Editing Existing Excel File, Without Opening Excel

    I have a (non-MS office) VBA project I am currently working on, and currently, in this project, I have set Excel as an object, where the current Excel file I am using needs to be currently opened. I have seen a method using:
    Please Login or Register  to view this content.
    that may allow me to do what I am needing to be done, however, I can honestly say I have used this before.

    So, very briefly if anyone could assist me, here are the exact steps I need to happen and maybe someone could point me in the right direction...

    Lets start by saying the Excel file I need is: C:\User\ExcelFile.xlsx
    1. Excel starts from A1 then goes down the column until it finds the next empty cell
    2. Value of this empty cell = iVal1
    3. Same row, now column B = iVal2
    4. Same row, Column C = iVal3
    5. Same row, Column D = iVal4

    So I believe the way I use the Open function is:
    Please Login or Register  to view this content.
    but once it's opened as #1, how do I manipulate the values as described in the above list?

    And a quick note... Keep in mind I am not using Excel to manipulate this Excel File. So I currently have this function in a module:

    Please Login or Register  to view this content.
    however, there is no guarantee I will even have Excel open at all, so instead of GetObject, I will probably need to CreateObject instead - but if you assist in the matter if you could kindly implement the object appXL where necessary I would be extremely grateful (I'm okay with a With appXL statement as well btw)!

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Editing Existing Excel File, Without Opening Excel

    Hello kbdavis,

    Opening an Excel workbook using the Open statement will not work for editing Excel files with xlsx or xlsm extensions. The newer files are zipped XML files. Excel files with an xls extension are in Binary Information File Format (BIFF). Even if your version of VBA supports ADO objects, you will be able to read but not change the file data.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 2
    Last Post: 05-31-2014, 02:05 AM
  2. EXCEL 2013 - opening read only files and editing them
    By sca1079 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-23-2014, 09:03 PM
  3. Replies: 0
    Last Post: 09-06-2013, 05:31 AM
  4. Replies: 4
    Last Post: 01-24-2012, 12:52 PM
  5. Opening Existing Word file from Excel VBA
    By rbyrd023 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 12-10-2010, 02:09 PM
  6. [SOLVED] Can I use Excel, opening and editing files, online?
    By AlisonHunter in forum Excel General
    Replies: 0
    Last Post: 06-01-2006, 06:45 AM
  7. Opening an existing Word File from within Excel
    By AJO in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-13-2006, 03:15 PM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1