+ Reply to Thread
Results 1 to 17 of 17

Will Macro work on a hidden spread sheet

  1. #1
    Registered User
    Join Date
    12-04-2013
    Location
    Cape Cod, Massachussutts, USA
    MS-Off Ver
    Excel 2013
    Posts
    20

    Will Macro work on a hidden spread sheet

    I have a big program I'm working on. One of the spreadsheets is just a feeder sheet that uses outlook calendar field names so it's really ugly. That's why I prefer to hide this sheet.

    Will the macros that are exported and imported into a hidden spread sheet like this still work?

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2411
    Posts
    26,726

    Re: Will Macro work on a hidden spread sheet

    Yes. The macro code doesn't care if the sheet is visible or not. You can test this yourself by trying a simple example.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,862

    Re: Will Macro work on a hidden spread sheet

    You probably mean worksheet which is hidden (macros could be included in worksheet code, but more often are located in a module, which is associated with workbook, not with worksheet).

    In this case - general answer is: yes macros wil work on it.

    Keep in mind that there are two levels of hiding worksheets - via the interface you can only make it hidden or visible. With VBA you can make it visible, hidden or very hidden! Check out worksheet properties in VBE (Ctrl+F11).

    Best Regards,

  4. #4
    Registered User
    Join Date
    12-04-2013
    Location
    Cape Cod, Massachussutts, USA
    MS-Off Ver
    Excel 2013
    Posts
    20

    Re: Will Macro work on a hidden spread sheet

    Yes it's a Workbook with like 12 different work sheets.

    On the tabs below I would like it if the ugly work sheet does not appear.

    This sheet has Macro's going to and from it.

    Just wondering if the macros will still work.

    It doesn't have to be very hidden.

  5. #5
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,862

    Re: Will Macro work on a hidden spread sheet

    OK. There is a hatch. If you have a macro, which has been registered for this (hidden) sheet - it will probably not work. In the registered code you will have almost everywhere constructuions like
    Please Login or Register  to view this content.
    99,9% of such constructions could be changed into:
    Please Login or Register  to view this content.
    Which works on hidden worksheets.

  6. #6
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,644

    Re: Will Macro work on a hidden spread sheet

    Quite hard to tell if the code will work on a hidden sheet without seeing the code.
    If posting code please use code tags, see here.

  7. #7
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Will Macro work on a hidden spread sheet

    What Kaper is saying is that you can't use select on a hidden sheet, so you must not code anything to select a range on a hidden sheet - otherwise the code should work
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  8. #8
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2411
    Posts
    26,726

    Re: Will Macro work on a hidden spread sheet

    Quote Originally Posted by xladept View Post
    ...you can't use select on a hidden sheet...
    Omission on my part, quite true. If you have macros that were generated by the macro recorder then you will certainly have this type of construct and have problems.

  9. #9
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,644

    Re: Will Macro work on a hidden spread sheet

    There are other things that aren't possible to do with a sheet that's hidden.

    For example, you can't copy a sheet that's hidden.

  10. #10
    Registered User
    Join Date
    12-04-2013
    Location
    Cape Cod, Massachussutts, USA
    MS-Off Ver
    Excel 2013
    Posts
    20

    Re: Will Macro work on a hidden spread sheet

    So this Spread sheet takes 7 fields from column in the sheet in front of it in the work flow and use those values in 7 columns.

    Then this whole sheet has a 1 way sync to outlook calendar.

    What I'm not sure about is if that sync will be a import from outlook or a export from this sheet.

    So what do you guys think? Will it work or is there something else easier here that I am missing to make this ugly sheet be hidden.

  11. #11
    Registered User
    Join Date
    12-04-2013
    Location
    Cape Cod, Massachussutts, USA
    MS-Off Ver
    Excel 2013
    Posts
    20

    Re: Will Macro work on a hidden spread sheet

    I know this sounds stupid or maybe stating the obvious but all the macros will be done before making the work sheet invisible.

    I'm new to Excel so please cut me a break. Never had any classes and only owned Excel for 2 months.

  12. #12
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2411
    Posts
    26,726

    Re: Will Macro work on a hidden spread sheet

    Always a good idea to attach your file to get advice specific to your situation. Having your file will let us experiment with your data, formulas, and code, and possibly attach a file with a completed solution.

    To post a file:
    1. Under the text box where you type your reply click the Go Advanced button.
    2. In the next screen look above the reply box and click the "paper clip" icon. You will get a pop-up screen.
    3. In the pop-up, click Add then Select to select a file from your local drive
    4. Click the Upload button to upload the file
    5. Click Done to attach it.

    It will be displayed as an attachment underneath your post text. Alternatively as the last step you can click the Insert Inline button and a hyperlink to the file will be inserted directly into your post text in the spot where your cursor is set at the moment you click the button.

  13. #13
    Registered User
    Join Date
    12-04-2013
    Location
    Cape Cod, Massachussutts, USA
    MS-Off Ver
    Excel 2013
    Posts
    20

    Re: Will Macro work on a hidden spread sheet

    I will upload here later when I get a chance. I can't load the whole thing here as it has a non disclosure agreement on it between me and 2 other programmers as a whole so I have to figure out how later how to remove just one of the work sheets out of the work book.

  14. #14
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Will Macro work on a hidden spread sheet

    Just put some phony data in that worksheet

    BTW - Norie is right about copying from a hidden sheet, but if ws is hidden you can still make assignments from it:

    Please Login or Register  to view this content.
    Oh! And thanks for the rep
    Last edited by xladept; 12-16-2013 at 03:38 PM.

  15. #15
    Registered User
    Join Date
    12-04-2013
    Location
    Cape Cod, Massachussutts, USA
    MS-Off Ver
    Excel 2013
    Posts
    20

    Re: Will Macro work on a hidden spread sheet

    Okay here it is without any macros
    Attached Files Attached Files

  16. #16
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2411
    Posts
    26,726

    Re: Will Macro work on a hidden spread sheet

    Quote Originally Posted by schmidtpainting View Post
    Okay here it is without any macros
    In my opinion this is backwards from what we need--in this case it would be more useful to see the code that will operate on this sheet. The issues that arise when you run code on a hidden sheet are not evident from the sheet itself, they are evident only in the code.

  17. #17
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Will Macro work on a hidden spread sheet

    Best if we got the code and all the sheets, including the hidden one

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Macro does not work on all spread sheets. May need to create new VBA Code.
    By Dariusd7 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 12-03-2013, 12:12 PM
  2. Generating New Spread Sheets with Info from the very last work sheet
    By jasw529 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-28-2013, 08:52 AM
  3. How to work with a hidden sheet?
    By bryan444 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 12-04-2012, 10:43 AM
  4. [SOLVED] How do I set up a spread sheet that will add my hours work in h:mm
    By Johnnyboy7444 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-17-2006, 04:10 AM
  5. Function help:work in spread sheet
    By Derrell Roberts in forum Excel General
    Replies: 1
    Last Post: 08-12-2005, 07:05 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1