If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
DoCmd.TransferSpreadsheet help
trying to export a query ("PBDM DATE RANGE") to Excel. Is my code wrong or
does it need to go further? Private Sub cmdDCFM_PBDM_Click() DoCmd.TransferSpreadsheet acExport, 9, "PBDM DATE RANGE", "C:\My Documents\Trial.xls", True End Sub Thanks for your time! -- GD |
#2
|
|||
|
|||
DoCmd.TransferSpreadsheet help
What happens when you try running the code? Do you get an error? If so,
what's the erro? If you don't get an error, what does happen? -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no e-mails, please!) "GD" wrote in message ... trying to export a query ("PBDM DATE RANGE") to Excel. Is my code wrong or does it need to go further? Private Sub cmdDCFM_PBDM_Click() DoCmd.TransferSpreadsheet acExport, 9, "PBDM DATE RANGE", "C:\My Documents\Trial.xls", True End Sub Thanks for your time! -- GD |
#3
|
|||
|
|||
DoCmd.TransferSpreadsheet help
What is happening that makes you think that there is a problem?
-- Jerry Whittle - MS Access MVP 2007 - 2009 Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder "GD" wrote: trying to export a query ("PBDM DATE RANGE") to Excel. Is my code wrong or does it need to go further? Private Sub cmdDCFM_PBDM_Click() DoCmd.TransferSpreadsheet acExport, 9, "PBDM DATE RANGE", "C:\My Documents\Trial.xls", True End Sub Thanks for your time! -- GD |
#4
|
|||
|
|||
DoCmd.TransferSpreadsheet help
Nothing happens when I click the command button.
-- GD "Jerry Whittle" wrote: What is happening that makes you think that there is a problem? -- Jerry Whittle - MS Access MVP 2007 - 2009 Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder "GD" wrote: trying to export a query ("PBDM DATE RANGE") to Excel. Is my code wrong or does it need to go further? Private Sub cmdDCFM_PBDM_Click() DoCmd.TransferSpreadsheet acExport, 9, "PBDM DATE RANGE", "C:\My Documents\Trial.xls", True End Sub Thanks for your time! -- GD |
#5
|
|||
|
|||
DoCmd.TransferSpreadsheet help
Are you sure that the code is actually linked to the button (code sometimes
gets unlinked). Look at the Property window. Does it have [Event Procedure] as the value for the Click property? If you click on the ellipsis (...) to the right of the property, are you taken into the VB Editor in the midst of that code? -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no e-mails, please!) "GD" wrote in message news Nothing happens when I click the command button. -- GD "Jerry Whittle" wrote: What is happening that makes you think that there is a problem? -- Jerry Whittle - MS Access MVP 2007 - 2009 Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder "GD" wrote: trying to export a query ("PBDM DATE RANGE") to Excel. Is my code wrong or does it need to go further? Private Sub cmdDCFM_PBDM_Click() DoCmd.TransferSpreadsheet acExport, 9, "PBDM DATE RANGE", "C:\My Documents\Trial.xls", True End Sub Thanks for your time! -- GD |
#6
|
|||
|
|||
DoCmd.TransferSpreadsheet help
Doug - Nothing happens when I click the command button. No activity or error
message. -- GD "Douglas J. Steele" wrote: What happens when you try running the code? Do you get an error? If so, what's the erro? If you don't get an error, what does happen? -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no e-mails, please!) "GD" wrote in message ... trying to export a query ("PBDM DATE RANGE") to Excel. Is my code wrong or does it need to go further? Private Sub cmdDCFM_PBDM_Click() DoCmd.TransferSpreadsheet acExport, 9, "PBDM DATE RANGE", "C:\My Documents\Trial.xls", True End Sub Thanks for your time! -- GD |
#7
|
|||
|
|||
DoCmd.TransferSpreadsheet help
Yes, that seems to be OK. Is 9 the right value for an Excel 2003 worksheet?
-- GD "Douglas J. Steele" wrote: Are you sure that the code is actually linked to the button (code sometimes gets unlinked). Look at the Property window. Does it have [Event Procedure] as the value for the Click property? If you click on the ellipsis (...) to the right of the property, are you taken into the VB Editor in the midst of that code? -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no e-mails, please!) "GD" wrote in message news Nothing happens when I click the command button. -- GD "Jerry Whittle" wrote: What is happening that makes you think that there is a problem? -- Jerry Whittle - MS Access MVP 2007 - 2009 Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder "GD" wrote: trying to export a query ("PBDM DATE RANGE") to Excel. Is my code wrong or does it need to go further? Private Sub cmdDCFM_PBDM_Click() DoCmd.TransferSpreadsheet acExport, 9, "PBDM DATE RANGE", "C:\My Documents\Trial.xls", True End Sub Thanks for your time! -- GD |
#8
|
|||
|
|||
DoCmd.TransferSpreadsheet help
There isn't a type 9. Try putting acSpreadsheetTypeExcel9 or 8 instead.
You might want to look into some error trapping as an exception should have been raised. Or maybe you have Set Warning turned off somewhere? -- Jerry Whittle - MS Access MVP 2007 - 2009 Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder "GD" wrote: Nothing happens when I click the command button. -- GD "Jerry Whittle" wrote: What is happening that makes you think that there is a problem? -- Jerry Whittle - MS Access MVP 2007 - 2009 Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder "GD" wrote: trying to export a query ("PBDM DATE RANGE") to Excel. Is my code wrong or does it need to go further? Private Sub cmdDCFM_PBDM_Click() DoCmd.TransferSpreadsheet acExport, 9, "PBDM DATE RANGE", "C:\My Documents\Trial.xls", True End Sub Thanks for your time! -- GD |
#9
|
|||
|
|||
DoCmd.TransferSpreadsheet help
As Jerry stated, you should use the named constant acSpreadsheetTypeExcel9
(or acSpreadsheetTypeExcel8) -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no e-mails, please!) "GD" wrote in message ... Yes, that seems to be OK. Is 9 the right value for an Excel 2003 worksheet? -- GD "Douglas J. Steele" wrote: Are you sure that the code is actually linked to the button (code sometimes gets unlinked). Look at the Property window. Does it have [Event Procedure] as the value for the Click property? If you click on the ellipsis (...) to the right of the property, are you taken into the VB Editor in the midst of that code? -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no e-mails, please!) "GD" wrote in message news Nothing happens when I click the command button. -- GD "Jerry Whittle" wrote: What is happening that makes you think that there is a problem? -- Jerry Whittle - MS Access MVP 2007 - 2009 Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder "GD" wrote: trying to export a query ("PBDM DATE RANGE") to Excel. Is my code wrong or does it need to go further? Private Sub cmdDCFM_PBDM_Click() DoCmd.TransferSpreadsheet acExport, 9, "PBDM DATE RANGE", "C:\My Documents\Trial.xls", True End Sub Thanks for your time! -- GD |
#10
|
|||
|
|||
DoCmd.TransferSpreadsheet help
Ah, I may have something here. Does it work with parameter queries, or just
selects? -- GD "Jerry Whittle" wrote: There isn't a type 9. Try putting acSpreadsheetTypeExcel9 or 8 instead. You might want to look into some error trapping as an exception should have been raised. Or maybe you have Set Warning turned off somewhere? -- Jerry Whittle - MS Access MVP 2007 - 2009 Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder "GD" wrote: Nothing happens when I click the command button. -- GD "Jerry Whittle" wrote: What is happening that makes you think that there is a problem? -- Jerry Whittle - MS Access MVP 2007 - 2009 Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder "GD" wrote: trying to export a query ("PBDM DATE RANGE") to Excel. Is my code wrong or does it need to go further? Private Sub cmdDCFM_PBDM_Click() DoCmd.TransferSpreadsheet acExport, 9, "PBDM DATE RANGE", "C:\My Documents\Trial.xls", True End Sub Thanks for your time! -- GD |
Thread Tools | |
Display Modes | |
|
|