Force Macro - question

ryan_law2000

Well-known Member
Joined
Oct 2, 2007
Messages
738
Ok so i know you cant force macro enable but this is kinda what i would like to do:

I have 10 Sheets
Going to make all sheets Hidden except for one
this sheet will just have something saying "MUST ENABLE MACROS"

when my workbook is opened the application is hidden and only a userform is shown
at this point i would like the rest of my sheets to be visible
couple names are: "Main Page" and "Enter"

now all the data will be gatherd through multiple userforms and eventually closing the userform with this code:

Code:
Private Sub CommandButton10_Click()
If MsgBox("Are you sure you want close Report", vbYesNo + vbQuestion) = vbYes Then
    ActiveWorkbook.Close savechanges:=False
Else
End If
End Sub

I would like to add to this code
Hide all sheets other then sheet named "WARNING"

So the next time the sheet is opened (if macro's are not enabled) it will just show the one "Warning" sheet. Once macro's are enabled again it should show the userform and unlock all the sheets.

This was just an Idea i thought might work but I wouldnt know what the code would be. and i have tried everything
 
Hi Thomas,

Thanks for your reply. I have already submitted a report to Symantec and waiting for their reply.
 
Upvote 0

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.
Hi Thomas,

Thanks for your reply. I have already submitted a report to Symantec and waiting for their reply.

Hi john.

I've just seen your question.

There is nothing to worry about running the code. You know it is not a virus :)
I guess the reason your anti-virus is alerting you is because the code creates a hidden ADS file and attachs it to the C:\Windows folder.
 
Upvote 0
I have been saving your code for use for a while now and just tried to run it. I am using Excel 2010 on Windows 7 and am getting an error at line of code:

Code:
Open FILE_PATH_NAME For Binary As #lFileNum

in this sub:

Code:
Private Sub EmbeedFile(ByVal PathName As String)

Dear Jaafar,

I know this is an old post but...
I have same issue on Excel 2016/Windows 10. Is there any chance to have a look at this please?

Thank you.

Kind Regards,
 
Upvote 0
Dear Jaafar,

I know this is an old post but...
I have same issue on Excel 2016/Windows 10. Is there any chance to have a look at this please?

Thank you.

Kind Regards,

I am afraid, Windows 10 seems to delete the ADS file immediately without warning... I couldn't make this work even after temporarly deactivating Windows Defender..
 
Upvote 0
I am afraid, Windows 10 seems to delete the ADS file immediately without warning... I couldn't make this work even after temporarly deactivating Windows Defender..
dam*it. Anyway, thanks a lot for your effort and time.
 
Upvote 0
Dear Jaafar,

I know this is an old post but...
I have same issue on Excel 2016/Windows 10. Is there any chance to have a look at this please?

Thank you.

Kind Regards,

Hello @Jaafar Tribak,

I am also having this same issue. I am using Windows 8 and excel 2016.
 
Upvote 0

Forum statistics

Threads
1,215,523
Messages
6,125,319
Members
449,218
Latest member
Excel Master

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
Back
Top