ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Exporting Logo from Access 97 to Excel 2000 by copy and pastespecial is stopping Cell A1 selection (https://www.excelbanter.com/excel-programming/390703-re-exporting-logo-access-97-excel-2000-copy-pastespecial-stopping-cell-a1-selection.html)

sid[_3_]

Exporting Logo from Access 97 to Excel 2000 by copy and pastespecial is stopping Cell A1 selection
 
Thank you Manu for your help. Your code was exactly what I was trying to
find. I have tried it but it only works without the logo.

I have tried this code to put the log on differently as I am copying the
logo from the form in access and pastespecial into each of the looped
worksheets which leaves the logo selected on each of the sheets.

This code looks at a folder on our network for the logo.
It works but it does not put the last logo onto cell "G1"
it puts the last one on cell "A1" I don't know if its because it is at
the end of loop.

Do Until Rst_2.EOF
FldName = Rst_2.Fields("ContractName")
Set shts = wkbk.ActiveSheet
wkbk.Sheets.add

objExc.Range("G1").Select
shts.Pictures.Insert ( _
"S:\Invoicing\PAYMENT CERTIFICATES\Payment Certificate
Database\Telent Logos\telent_logo.gif" _
)

regards,
Sid.






*** Sent via Developersdex http://www.developersdex.com ***

sid[_3_]

Exporting Logo from Access 97 to Excel 2000 by copy and pastespecial is stopping Cell A1 selection
 
This is just to let you know that I have now successfully fixed my
problem.

I had the pastespecial in the wrong place. I put it at the end instead
of the begining where the sheets were created.

this is my code now. It pastes the logo on to all the created worksheets
in position (1,7) and then finishes by selecting cells (1,1)


Do Until Rst_2.EOF
FldName = Rst_2.Fields("ContractName")
Set shts = wkbk.ActiveSheet

'puting the pastspecial of the logo here makes sure it is not
selected on each sheet
'and that each sheet finishes on cell "A1"
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 workshee
Set Rge = shts.Rows.Cells(1, 1)
Rge.Select


Thank you for all your help
regards,
Sid




*** Sent via Developersdex http://www.developersdex.com ***


All times are GMT +1. The time now is 05:06 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com