Forum Discussion
Smeac81
Dec 04, 2023Copper Contributor
Procedure is greyed out in VBA Insert pulldown
I am unfamiliar with VBA but find myself in dire need of its LTRIM function as I have imported my Excel project plan into Project (original Project file is corrupted) complete with leading spaces at ...
- Dec 08, 2023While you have all of the tasks (and summaries) in excel, and they all have leading spaces, why not remove them there before copying them and pasting them into MSP?
You could use a nested function like =proper(clean(trim))), and clean it all up in one go.
Proper() converts test to title case (or proper noun case), with caps on first character of each word.
Clean() removes unprintable characters, whatever they are but anyway they are removed.
Trim() removes leading, trailing and double spaces.
After, you just go through and re-do the WBS indents in MSP.
Smeac81
Dec 04, 2023Copper Contributor
Hi John,
Thank you for the reply. Yes, as you will see, very unfamiliar with VBA, I will apologize for that from the start.
I did discover that going the module route works and I don't need to use procedure. I am now able to start writing the code but can't get very far due to my lack of knowledge of VBA.
I actually had two versions of my Project file and both became corrupted - went from 1mb to 55mb, but I had earlier exported the Project file to Excel so others could see it that did not have Project. At that point, I did a copy/paste into Project and that is where the leading spaces were introduced I believe. I did try the Import Wizard in Project but that failed.
So now I want to use the LTRIM function in VBA to get rid of the leading spaces. Does that help?
Thank you for the reply. Yes, as you will see, very unfamiliar with VBA, I will apologize for that from the start.
I did discover that going the module route works and I don't need to use procedure. I am now able to start writing the code but can't get very far due to my lack of knowledge of VBA.
I actually had two versions of my Project file and both became corrupted - went from 1mb to 55mb, but I had earlier exported the Project file to Excel so others could see it that did not have Project. At that point, I did a copy/paste into Project and that is where the leading spaces were introduced I believe. I did try the Import Wizard in Project but that failed.
So now I want to use the LTRIM function in VBA to get rid of the leading spaces. Does that help?
TrevorATperfectproject
Dec 08, 2023Brass Contributor
While you have all of the tasks (and summaries) in excel, and they all have leading spaces, why not remove them there before copying them and pasting them into MSP?
You could use a nested function like =proper(clean(trim))), and clean it all up in one go.
Proper() converts test to title case (or proper noun case), with caps on first character of each word.
Clean() removes unprintable characters, whatever they are but anyway they are removed.
Trim() removes leading, trailing and double spaces.
After, you just go through and re-do the WBS indents in MSP.
You could use a nested function like =proper(clean(trim))), and clean it all up in one go.
Proper() converts test to title case (or proper noun case), with caps on first character of each word.
Clean() removes unprintable characters, whatever they are but anyway they are removed.
Trim() removes leading, trailing and double spaces.
After, you just go through and re-do the WBS indents in MSP.
- Smeac81Dec 08, 2023Copper ContributorThank you John/Trevor for your inputs. Yes all good input in hindsight, this helps me understand how best to deal with this in the future. I did manually delete the leading spaces as I had a time crunch to make a meeting deadline.
The original problem with the files being corrupted is elusive and IT (inside and 3rd party) say the laptop is just fine although it crashed in the meeting. But what do I know? So everything is fine as long as I don't use the laptop - using my personal laptop now.
Thanks again - Joe- John-projectDec 08, 2023Silver ContributorSmeac81,
You're welcome and thanks for the feedback.
John