Excel Bug: Run-time error '-2147417848 (80010108)'

M

majikman

I have been getting the following error:

Run-time error '-2147417848 (80010108)'
Method 'Paste' of 'object'_Worksheet' failed

The code below is generating that error when i choose yes to save thi
file as i am closing the excel file. the code works fine if i jus
click on save the save button before closing. another strange thing i
that after my code generates this error, excel won't close. it i
still partially functional. i can open a file. however, once i open th
file, there is content in the cells that i can see in the forumla ba
but the part of the screen where the worksheet is supposd to be is al
white. i'm thinking that this is some kind of bug in excel. anyone kno
whats going on?

Btw, the error is generated on the line marked with an asterik

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel A
Boolean)
Workbooks.Open ("C:\Documents and Settings\Adam\Desktop\Monthl
Sales\Bars 2004.csv")
Workbooks("Bars 2004.xls").Worksheets("Total Bar
MASTER").Activate
Range("D10:O12").Copy
Excel.Windows("Bars 2004.csv").Activate
Range("D10").Select
*Excel.Workbooks("Bars 2004.csv").Worksheets("Bars 2004").Paste
Excel.Workbooks("Bars 2004.csv").Close
End Su
 
M

majikman

to add to that... this is very interesting. my excel is now consumin
all available cpu usage and my total cpu usage is at 100% until
decide to end the process
 

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