Please can anyone help me. I have a form in Access 97 which has parameter fields that are used to extract
data from my database and Export to Excel when a button is clicked. We have Access 97 and Excel 2000 using the EXCEL9.OLB
My code is quite long as it loops though recordsets and exports to multiple worksheets.
The problem I am having is trying to export a logo from a folder on my harddrive and put the logo on to each worksheet at cells(1,7)
At the moment I have a picture field on my form called logo. When the button is clicked this is copied into memory
and pasted into the excel sheets. This does work ok.
Me.logo.SetFocus 'this just goes to the logo field so that it can be copied
DoCmd.RunCommand acCmdCopy 'this copies the logo into memory
Set Rge = shts.Rows.Cells(1, 7)
Rge.PasteSpecial 'this pastes the logo on after all other data so that it only pastes once into each worksheet
But because the logo is pasted on to each sheet I can not get my code to go to cell (1,1) to finish.
Each worksheet stops at the logo position. If I could end the focus on cell(1,1) this would save me having to open each sheet and manualy position onto cell(1,1) each week.
If I create a macro from excel I have this code but it does not work in access97
ActiveSheet.Pictures.Insert( _
"S:\Invoicing\PAYMENT CERTIFICATES\Payment Certificate Database\Telent Logos\telent_logo.gif" _
).Select
Selection.ShapeRange.IncrementLeft 0.75
Selection.ShapeRange.IncrementTop 4.5
Even though I have reference to EXCEL9.OLB in the references I can not find Pictures.Insert that would get the code going.
data from my database and Export to Excel when a button is clicked. We have Access 97 and Excel 2000 using the EXCEL9.OLB
My code is quite long as it loops though recordsets and exports to multiple worksheets.
The problem I am having is trying to export a logo from a folder on my harddrive and put the logo on to each worksheet at cells(1,7)
At the moment I have a picture field on my form called logo. When the button is clicked this is copied into memory
and pasted into the excel sheets. This does work ok.
Me.logo.SetFocus 'this just goes to the logo field so that it can be copied
DoCmd.RunCommand acCmdCopy 'this copies the logo into memory
Set Rge = shts.Rows.Cells(1, 7)
Rge.PasteSpecial 'this pastes the logo on after all other data so that it only pastes once into each worksheet
But because the logo is pasted on to each sheet I can not get my code to go to cell (1,1) to finish.
Each worksheet stops at the logo position. If I could end the focus on cell(1,1) this would save me having to open each sheet and manualy position onto cell(1,1) each week.
If I create a macro from excel I have this code but it does not work in access97
ActiveSheet.Pictures.Insert( _
"S:\Invoicing\PAYMENT CERTIFICATES\Payment Certificate Database\Telent Logos\telent_logo.gif" _
).Select
Selection.ShapeRange.IncrementLeft 0.75
Selection.ShapeRange.IncrementTop 4.5
Even though I have reference to EXCEL9.OLB in the references I can not find Pictures.Insert that would get the code going.