Open excel new blank excel workbook from MS Access

forrestgump

Registered User.
Local time
Today, 13:35
Joined
Aug 14, 2017
Messages
10
Hi All,

How do i open a new instance of an excel workbook from MS Access? I can open workbooks that are already created with the below code but not a new blank workbook:-

Code:
Set xlWB = .Workbooks.Open(Me.filepathbx & Me.lstFileList.ItemData(i))

Any help would be much appreciated.

Regards,

ForrestGump
 
Set xlWB=. Workbooks. Add
 
Not sure what you have before the Set line ...

This is what I use
Slightly longer than arnel's response but it's the full code:

Code:
 Dim xlApp As Excel.Application
    Dim xlWB As Excel.Workbook
    Set xlApp = New Excel.Application
    Set xlWB = xlApp.Workbooks.Add
    xlApp.Visible = True
    xlApp.Sheets("Sheet1").Select
    xlApp.Sheets("Sheet1").name = strFileName
 

Users who are viewing this thread

Back
Top Bottom