What am I doing wrong?

  • Thread starter chris23892 via AccessMonster.com
  • Start date
C

chris23892 via AccessMonster.com

what am I doing wrong here? I'm exporting a spreadsheet and I can only name
the querry a number. I need name the querry latters and numbers, but the VB
script will not work if it's named anything else:

Dim sXL As String, oXL As Object
sXL = "S:\blaa_blaa_blaa\Warranty Running Spreadsheets (All UNIT)\Pivot
Charts\iTC_pivot.xls" 'Full path of my preformatted target sheet
' 5 is the name of my querry. anything else besides a number will not work
DoCmd.TransferSpreadsheet acExport, , "5", sXL
Set oXL = CreateObject("Excel.Application")
oXL.Visible = True
oXL.WorkBooks.Open FileName:=sXL
 
C

chris23892 via AccessMonster.com

can not find querry or querry spelled wrong....

someto that line. everything esle works fine, just the way I have querry
named. If I put letters in the name (yes, I put the name in the quotes in
place of the 5) I get the error. when I name the queery a number, it works
fine.



Alex said:
hi,
What error do you get?
what am I doing wrong here? I'm exporting a spreadsheet and I can only
name
[quoted text clipped - 11 lines]
oXL.Visible = True
oXL.WorkBooks.Open FileName:=sXL
 
A

Alex Dybenko

Well, no idea so far what could it be...
try to use DoCmd.OutputTo instead

--
Best regards,
___________
Alex Dybenko (MVP)
http://accessblog.net
http://www.PointLtd.com

chris23892 via AccessMonster.com said:
can not find querry or querry spelled wrong....

someto that line. everything esle works fine, just the way I have querry
named. If I put letters in the name (yes, I put the name in the quotes in
place of the 5) I get the error. when I name the queery a number, it works
fine.



Alex said:
hi,
What error do you get?
what am I doing wrong here? I'm exporting a spreadsheet and I can only
name
[quoted text clipped - 11 lines]
oXL.Visible = True
oXL.WorkBooks.Open FileName:=sXL
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top