Access Exported data to Excel....Excel file Error (1 Viewer)

sumox

Registered User.
Local time
Today, 23:27
Joined
Oct 1, 2013
Messages
89
I've vba in Report onformat

the vba code does some data copying to External Excel file (premade
by vba)

Now on first run, i got success

But on opening the excel file, it showed blank space + Error"File already opened"

No White Spreadsheet is shown with data

to seeinto file, i created new excel file in windows, and inserted the vba created/exported file as an Obj.

Now Obj is showing correct and full data with spreadsheet as normal view

Why it's occuring? :banghead:
 

pr2-eugin

Super Moderator
Local time
Today, 17:57
Joined
Nov 30, 2011
Messages
8,494
Please show the code you are using to export.
 

sumox

Registered User.
Local time
Today, 23:27
Joined
Oct 1, 2013
Messages
89
sending....
 

sumox

Registered User.
Local time
Today, 23:27
Joined
Oct 1, 2013
Messages
89
Code:
Private Sub ReportFooter_Format(Cancel As Integer, FormatCount As Integer)
 
Dim xlApp As New Excel.Application
Dim xlWrkBk As Excel.Workbook
Dim xlSht As Excel.Worksheet
''Dim myRec As DAO.Recordset
'Dim fldCustName As String
 
Set xlWrkBk = GetObject("yeru.xls")
Set xlSht = xlWrkBk.Worksheets(1)
 
'Set myRec = CurrentDb.OpenRecordset("tblTest")
fldCustName = "Gword(" & Me.ImportGT.Value & ")"
'
'
''myRec.MoveFirst
'
xlSht.Cells(1, "A") = fldCustName
xlWrkBk.Save
xlWrkBk.Close
 
End Sub
 

sumox

Registered User.
Local time
Today, 23:27
Joined
Oct 1, 2013
Messages
89
i don't want to send a records bunch

but just a UB field value
 

Users who are viewing this thread

Top Bottom