access violation 0cx0000005 in vba excel

N

ngm

Dear recipient:

I have this error access violatio 0cx0000005 to open file excel,
generate this file in code vba.Don't have idea where is the error.

I have a next code fragment

For p = 0 To num_pems - 1
Workbooks(libro_paquete).Activate
Sheets("MFisicas " & pems(p)).Select
MsgBox "pem i" & pems(p)
Sheets("MFisicas " & pems(p)).Delete
Next
Application.DisplayAlerts = True


Workbooks(libro_paquete).Save
Workbooks(libro_paquete).Close

if elimite the sentence for to open file correct.

Can you help me please?

Regards
 

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