Consulting

Results 1 to 3 of 3

Thread: Export to Excel Macro?

  1. #1

    Export to Excel Macro?

    I've read that their are ways to export a report from access -> excel without overwriting the file completely. Is this true? All the tutorials I've looked up have said nothing about it, and it always leaves me overwriting the file.

    I need it to be exported to say, Sheet 2 of a given excel file, for example? Is that even possible?

    I'm also trying to do this in a Macro as part of my automation process and I'm using office 2007.
    "My common sense is tingling!" - Deadpool
    http://marveldcforum.com

  2. #2
    VBAX Contributor
    Joined
    Oct 2011
    Location
    Concord, California
    Posts
    101
    Location
    How about posting solution for the benefit of all?

  3. #3
    Went in a different direction. Used a link code here to run macros instead of a report:


    With ActiveSheet.ListObjects.Add(SourceType:=0, Source:=Array( _
    "OLEDB;Provider=Microsoft.ACE.OLEDB.12.0;Password="""";User ID=Admin;Data Source=" & dbFile & ";Mode=Share Deny Write;" _
    , _
    "Extended Properties="""";Jet OLEDB:System database="""";Jet OLEDB:Registry Path="""";Jet OLEDBatabase Pas" _
    , _
    "sword="""";Jet OLEDB:Engine Type=6;Jet OLEDBatabase Locking Mode=0;Jet OLEDB:Global Partial Bulk Ops=2;Jet OLEDB:Global Bulk Tra" _
    , _
    "nsactions=1;Jet OLEDB:New Database Password="""";Jet OLEDB:Create System Database=False;Jet OLEDB:Encrypt Database=False;Jet OLEDB" _
    , _
    "on't Copy Locale on Compact=False;Jet OLEDB:Compact Without Replica Repair=False;Jet OLEDB:SFP=False;Jet OLEDB:Support Complex" _
    , " Data=False"), Destination:=Range("$B$15")).QueryTable
    .CommandType = xlCmdTable
    .CommandText = Array("qry_Report1")
    .RowNumbers = False
    .FillAdjacentFormulas = False
    .PreserveFormatting = True
    .RefreshOnFileOpen = False
    .BackgroundQuery = True
    .RefreshStyle = xlInsertDeleteCells
    .SavePassword = False
    .SaveData = True
    .AdjustColumnWidth = True
    .RefreshPeriod = 0
    .PreserveColumnInfo = True
    .SourceDataFile = _
    dbFile
    .ListObject.DisplayName = tableText
    .Refresh BackgroundQuery:=False
    End With
    "My common sense is tingling!" - Deadpool
    http://marveldcforum.com

Posting Permissions

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