Cannot set visible property to the worksheet class

jarlej

New Member
Joined
Sep 24, 2020
Messages
2
Office Version
  1. 365
Platform
  1. MacOS
Hi,
Could anybody point me to a solution?

I get run-time error '1004' at the last line: Cannot set visible property to the worksheet class

VBA Code:
Sub kopierLoggPedTiltak()
    Sheets("LoggPedTiltak").Copy After:=Sheets(1)
    ActiveSheet.Visible = 1
    Sheets("Innhold").Visible = 0
End Sub

Thanks!

(I used to be a member like 10+ years ago, but couldn't find my old login :()
 

Some videos you may like

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.

davesexcel

Well-known Member
Joined
Feb 26, 2006
Messages
1,089
Here is a topic on that

Just a note, the activesheet would be visible, you would not have to make it visible.

 

jarlej

New Member
Joined
Sep 24, 2020
Messages
2
Office Version
  1. 365
Platform
  1. MacOS
Hi, and thanks for the tip. I´ve already seen that topic, but I couldn't find a solution in that thread.
 

Watch MrExcel Video

Forum statistics

Threads
1,127,595
Messages
5,625,710
Members
416,128
Latest member
WarJamAnd

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top