ms-project

converting values of java.util.list to string or other normal format in vb

前提是你 提交于 2019-12-13 06:43:53
问题 in my application, I am pulling in items from a microsoft project file using mpxj - one of the items I need is the predecessors. The way I am able to pull the predecessor is using a build in function of mpxj which returns a type of java.util.list - I can save this to variable as an object, but I need to find a way to bring the data to a format I can easily use so I can store it into a database. Listed below is the line of code I am using to pull the predecessors from the project file. Dim

can't set PageSetup.Orientation = xlLandscape from MS Project

拟墨画扇 提交于 2019-12-12 23:03:27
问题 Using VBA in MS Project 2003 I create an Excel sheet and write data to it. After that I want to change SetPrintArea and Orientation of the sheet I created so I wrote with xlsheet '// Defined being an Excel.Worksheet For i = 1 To .UsedRange.Columns.Count .Columns(i).EntireColumn.AutoFit Next i txtPrintArea = txtPrintArea & "$" & xlCol.Row '// I created the range to print before With .PageSetup .Orientation = xlLandscape .PrintArea = xlSheet.UsedRange.Address End With End With It crashes at the

Loop through all TableFields in Microsoft Project add to combobox

谁都会走 提交于 2019-12-12 21:48:40
问题 I'm stuck trying to create a UserForm in VBA with a combobox that lists all possible TableFields(?). Updated code: Using the code provided by @dbmitch and some freestyle. This lists a two-column combobox with both the Original and the Custom field name (if it exists). It only lists the fields used in the Activeproject. Not all possible fields. But if the field isn't used in the Activeproject anyway... maybe this is for the best! Public strResult2 As String ' Used for custom field names

How to add a new column in Microsoft Project from Excel VBA?

∥☆過路亽.° 提交于 2019-12-11 15:54:08
问题 I'm writing a Sub in Excel right now with VBA. I've successfully opened a MS Project project. Now, I want to add a new column in the MS Project file via Excel VBA. How do I do this? '''vba Dim MSProject As MSProject.Application Dim project As MSProject.project Dim wb As Workbook Dim ws As Worksheet Set wb = ThisWorkbook Set ws = Sheets("Sheet1") wb.Activate ws.Select ' Open Microsoft Project project Set MSProject = CreateObject("MSProject.Application") With MSProject .FileOpen "test.mpp"

Referencing MSProject in Excel VBA produces Runtime Error 91 object variable or with block variable not set

假装没事ソ 提交于 2019-12-11 14:32:07
问题 My objective is to loop through a number of MS Project documents where the file paths (e.g. L:\Project\Scchedule.mpp) are stored on worksheet "Projects" in column C (beginning in cell C2). This line returns runtime error 91 (object variable or with block variable not set). PrjApp.Application.FileOpenEx PrjFullName Sub OpenProjectCopyPasteData() Dim PrjApp As MSProject.Application Dim aProg As MSProject.Project Dim PrjRange As Range Dim PrjFullName As String Dim t As Task Dim rng As Range Dim

MSProject Add-In to convert .mpp in .pdf with given name and date

ε祈祈猫儿з 提交于 2019-12-11 09:47:29
问题 I am developing an Add-In for MSProject 2013 and higher. I want to safe/convert the opened .mpp file into an .pdf file without having an additional dialog for the user. He just presses the button an gets an notification when everything is done. I need to save it in a spacific path and user a defined start and end date. I tried the SaveAs-methode, but since it takes an MSProject.PjFileType as input and the is no option for pdf, I can't use this. PjFileFormat Enumeration An other approche was

How to iterate through open forms in a VSTO add-in?

元气小坏坏 提交于 2019-12-11 06:39:55
问题 I have a VSTO add-in for MS Project that opens forms where the data is related to the specific project file that was active when the form was open. It is possible to open one form related to one project file, while having another different form open that is related to a second open project file. When I close a project file I would like to check each open form, and close it if the forms base project ID equals the project ID of the project file that is closing. How do I access the open forms

Where can I save the settings entered by the user?

一曲冷凌霜 提交于 2019-12-11 01:55:36
问题 VBA. Step 1 The MS Project file is open; The user starts the macro; The form is opened; The user enters the path; The user clicks "Save"; The user closes the form; The user closes the MS Project file. Step 2 The user opens the MS Project file; The user wins the macro; The form is opened; The form displays the path that the user has registered for "Stage 1"; Questions How to make that when the user opens the form a second time (Step 2) in the form was displayed the path that was saved in (Step

How to SelectRow of a Task in Sub-Project (inside a Master-Project)

耗尽温柔 提交于 2019-12-11 01:48:48
问题 I have a Master-Project, and inside it I have several Sub-Projects. I want to format the Color of the Rows based on a value of a field Text5 . Current Problem : How to use VBA code to refer to the Row in the 2nd Sub-Project. When I run the code, and I modify Text5 value in Task ID 5 (in Sub-Project 2), it modifies the color of Task ID 5, but of Sub-Project 1. How can I use the SelectRow and add refference to the desired Sub-Project ? My Code (relevant section) Sub FormatChangedTasks() Dim

Color coding tasks in a Microsoft Project Macro

自作多情 提交于 2019-12-11 00:26:25
问题 This seems like it should be straight forward, but I'm seeing some strange behavior. I'm attempting to color code my tasks based on a flag. It appears to be correctly coloring the tasks, but at some point in the processing the initial tasks that were colored are getting reset to black. The task that it happens on seems to be fairly inconsistent too. Here's how I'm trying to perform this task (simplified to it's barest form): Sub ColorTasks() Dim t As Task For Each t In ActiveProject.Tasks