Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi everybody,
I have a problem again. On Friday I prepare a macro where I open an exsisted excel file, drop a table on a sheet and close the file while saving with another name. It has worked.
Than I reload the script on saturday, but nothing is happend Now the script shows me the error "select-method of the range-object could not be implenemt".
If I worte for the range cell, could the object not be suported. What's wrong with the code?
Regards Vicky
The excel-file has one sheet with expressions and a diagramm, with fetch the data from the sheet Datenblatt. There are also four sheets with different pivot tables. And the sixth sheet is the sheet "Datenblatt" with no merged cells, or images, or expression. Only the table CH09 with former data is on it.
If it helps, you can rewrite the code so that it workes.
weird stuff
but
if i select multiply sheets (right mouse button + Ctrl) and save the excell - macro failed like you report:)
did you check this?
check this file
(do not open it - just save to K catalog)
No, I haven't got selected more than one sheet. But I haven't got selected the sheet "Datenblatt".
If I do that, the macro works fine. That's worst
Because I don't want start on the sheet "Datenblatt", if I open the excel file. I also can't guarantee, that my colleagues remember that they have to leave the excel file on this sheet, which they don't interessted.
Can I say the Excel file something like, if time is < 06:00, then open with sheet "Datenblatt", otherwise with "Überblick"?
as i see you can add one extra line
Set objCurrentSheet = objExcelDoc.Sheets("Datenblatt")
objExcelDoc.Sheets("Datenblatt").Select
objExcelDoc.Sheets("Datenblatt").Range("A1").Select
this should help you
BTW what is this object for ... objCurrentSheet ?
*head meets desk*
I though the line Set objCurrentSheet = objExcelDoc.Sheets("Datenblatt") was the selecting. I should find the time to learn intensiv more VB-Scripting.
Thank you very much
hmm... the objCurrentSheet is perhaps a remnant of my attempts.
i'm poor VB programist to but still wonder why line:
objExcelDoc.Sheets("Datenblatt").Range("A1").Select
doesn't activate the sheet 😕
I also haven't much knowledge in VB. But I'm happy, that it works now