exporting excel data - welcome to the la-ocmug · pdf filethat contains the latest updates....

12
1 OBJE Ov On Ho Copy1 CTIVES verview of the ne time compu ow to export Ex Expo Micro right © 2006 Califeature ter setup xcel data into M orting oStat fornia Department MicroStation V g Exce ion V t of Transportation V8 2004 el Dat V8 200 n ta into 04 5/10/2010 o

Upload: trananh

Post on 13-Feb-2018

216 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Exporting Excel data - Welcome to the LA-OCMUG · PDF filethat contains the latest updates. ... This will fix the DLL file problem. ... Before you start exporting Excel data into MicroStation,

1

OBJE

Ov

On

Ho

Copyr

1

CTIVES verview of the

ne time compu

ow to export Ex

ExpoMicro

right © 2006 Calif

feature

ter setup

xcel data into M

ortingoStat

fornia Department

MicroStation V

g Exceion V

t of Transportation

V8 2004

el DatV8 200

n

ta into04

5/10/2010

o

Page 2: Exporting Excel data - Welcome to the LA-OCMUG · PDF filethat contains the latest updates. ... This will fix the DLL file problem. ... Before you start exporting Excel data into MicroStation,

Overview of Feature

2 Copyright © 2006 California Department of Transportation 5/10/2010

OVERVIEW OF FEATURE

HOW THIS WORKS How the Excel data is exported into MicroStation is done with a VBA (Macro) program that is stored in an Excel file provided by Headquarters. There are specific steps that need to be followed to ensure success. This document will outline these steps.

This Macro program was created to facilitate the transferring of Microsoft Excel spread sheet data into a MicroStation V8 2004 DGN file. The Macro will convert the Excel data into MicroStation elements and let you place them as a Table per Caltrans Plan Preparation manual standards. This Macro was designed to work with English files, either V7 or V8 file format.

This is a one–way trip for the Excel Data; the Data in the Excel file will not be “linked” to the Data in the MicroStation DGN file. You might want to have a plan to make the Data in the Excel file the master, only making numeric or value changes in the Excel file and then re-exporting the Data to MicroStation. Avoid making changes to both the MicroStation elements and different changes to the Excel file, this could result in mistakes.

If you have any problems, questions or suggestions, please contact Headquarters at:

916 227-2636 or Calnet 8-498-2636

Page 3: Exporting Excel data - Welcome to the LA-OCMUG · PDF filethat contains the latest updates. ... This will fix the DLL file problem. ... Before you start exporting Excel data into MicroStation,

One Time Computer Setup

3 Copyright © 2010 California Department of Transportation 5/10/2010

ONE TIME COMPUTER SETUP Before you use the Excel Macro, you will need to check or do the following things:

• Check that you have the most current update of MicroStation V8 2004

• You need to run the Batch file that will update a MicroStation DLL file

• Change your Excel Macro Security to low

UPDATING MICROSTATION You will need the most current update of MicroStation in order to use the Macro to export Excel data into MicroStation. As mentioned before, the Macro that exports the Excel data is stored in an Excel file. The Excel file is part of an additional update for Update No.3 for MicroStation V8 2004. To check which update you have on your computer, do the following steps.

STEPS: CHECKING VERSION OF MICROSTATION UPDATE

1. Open your Windows explorer 2. Go to your C: Drive 3. Open the folder named C:\Cal.Versions\

4. Locate the file named versat.bat and double click on it.

Page 4: Exporting Excel data - Welcome to the LA-OCMUG · PDF filethat contains the latest updates. ... This will fix the DLL file problem. ... Before you start exporting Excel data into MicroStation,

One Time Computer Setup

4 Copyright © 2006 California Department of Transportation 5/10/2010

5. This file will check which MicroStation update you have on your computer. This Batch file will open a window that will indicate which update you have. If you have the most current update, the window should like the following image. You are looking for the text line that says: CTM8-UPD3-PATCHadditioanalFiles_4.installed:CTM8-UPD4 Version 8.1.4 MS08.05.02.72 (05-13-08)

6. If you do not have the text line indicated above, then you will need to do the following steps. If you do have the most current update, then you can skip to the next section named REPLACING THE FM20.DLL FILE.

7. To install the current update of MicroStation, open your Internet Explorer. 8. In the address field, type in CADD and then press enter. This will take you to the CADD GIS

Support page. 9. On the green tabs across the top, select MicroStation. This will take you to the MicroStation

support page. 10. On the right side of the page you will see a link to Additional files and Resources. Click on that

link. 11. This page contains three links near the middle of the page; the first link will download a ZIP file

that contains the latest updates. The last link is to a PDF file that contains instructions on how to install the updates. If you are not sure on how to install the updates, please click on the last link and follow the instructions in the PDF.

Hint: If you have problems performing this update or need assistance, contact your local MicroStation support or Headquarters at 916 227-2636 or Calnet 8-498-2636

Page 5: Exporting Excel data - Welcome to the LA-OCMUG · PDF filethat contains the latest updates. ... This will fix the DLL file problem. ... Before you start exporting Excel data into MicroStation,

One Time Computer Setup

5 Copyright © 2010 California Department of Transportation 5/10/2010

REPLACING THE FM20.DLL FILE There is a DLL file that needs to be updated and there is a Batch file that was created to do this. This only applies to computers with the universal image. If you are not sure what image you have, do the following steps.

STEPS: REPLACING THE FM20.DLL FILE

1. Exit MicroStation. This Batch file will not work if MicroStation is open. 2. Open the Internet Explorer 3. Go to the Web address listed below

http://cadd.dot.ca.gov/forum/index.php?topic=1051.msg10603#msg10603

4. This will take you to a CADD Forum thread where you can download the Batch file. Locate the attached file near the bottom of the thread and Right Click on it, and then select Save Target As… Save the attached file to a location on your local Hard Drive that you know how to get to after you download it. (i.e. C:\Temp\)

Warning Make sure you do not have MicroStation running before you double click!

5. After you have saved the attached file to your local Hard Drive, locate the file and double click on it

Page 6: Exporting Excel data - Welcome to the LA-OCMUG · PDF filethat contains the latest updates. ... This will fix the DLL file problem. ... Before you start exporting Excel data into MicroStation,

One Time Computer Setup

6 Copyright © 2006 California Department of Transportation 5/10/2010

6. You will see a DOS text window appear. You will be instructed to press any key to continue... Press any key on your keyboard to begin the process. The Batch file will close automatically when it has finished.

7. This will fix the DLL file problem.

SETTING MICROSOFT EXCEL MACRO SECURITY In order for Macro inside the Excel file provided by headquarters to run, you will most likely need to change your Macro Security in Microsoft Excel. The setting that will allow the Macro to run is Low.

STEPS: CHANGING THE EXCEL MACRO SECURITY TO LOW

8. Open Microsoft Excel 9. From the Menu bar, select Tools>Options 10. On the Options dialog select he Security Tab 11. On the Security Tab, select the Macro Security button in the lower right corner 12. On the Macro Security dialog, select the Low radio button 13. Click the OK button. 14. You will need to Exit and reopen Excel to make the changes take effect.

Warning Macros in Excel files have been used to spread computer viruses. By setting the Microsoft Excel Macro Security to Low, you are turning off a feature that prevents Macros from starting when opening an Excel file. After setting the Macro Security to Low to use the Macro which exports data to MicroStation, change it back to Medium or whatever it was set at before you changed it to Low.

Your computer is now up-to-date and you are ready to start exporting Excel spread sheet data into your MicroStation DGN files per the Caltrans standards for Quantity Tables.

Page 7: Exporting Excel data - Welcome to the LA-OCMUG · PDF filethat contains the latest updates. ... This will fix the DLL file problem. ... Before you start exporting Excel data into MicroStation,

Exporting Excel data to MicroStation

7 Copyright © 2010 California Department of Transportation 5/10/2010

EXPORTING EXCEL DATA TO MICROSTATION

OVERVIEW Before you start exporting Excel data into MicroStation, there are a few considerations. The Excel file provided by Headquarters that contains the Macro is located on the C Drive. If you have an existing Excel file with data that you want to export to MicroStation, you will need to consider the following.

You will need to open the provided Excel file at least once to load the Macro into Excel, before you try to export your Excel data.

You should copy and rename the provided Excel file and use it as a template for new Excel files.

You must have open the MicroStation DGN file you plan on importing Excel data into before running the Macro

The following steps will walk you through how to export Excel data into a sample MicroStation DGN file. You will need to modify these steps to work with your Excel data and MicroStation DGN files.

EXERCISE: EXPORTING EXCEL DATA INTO MICROSTATION

1. Open MicroStation V8 2004 2. Use a V7 or V8 English Seed File to create a DGN file named Sample.dgn. You can locate the

file anywhere you would like, it is not critical 3. After you have created the MicroStation file, open it. 4. Open Microsoft Excel 5. In Excel, go to File>Open 6. Locate the following Excel file named GenericTable.xls in the following folder

C:\Caltrans\HQ\MSta\Excel_Generic_Table\

7. After you have the opened the Excel file go to File>Save as… and save a copy of the Excel file and name it Demo.xls. The location and name are not critical to this exercise.

Page 8: Exporting Excel data - Welcome to the LA-OCMUG · PDF filethat contains the latest updates. ... This will fix the DLL file problem. ... Before you start exporting Excel data into MicroStation,

Exporting Excel data to MicroStation

8 Copyright © 2006 California Department of Transportation 5/10/2010

8. Once you have opened the Excel file, change Worksheets to Example 1. This Worksheet contains sample data you will export to MicroStation.

9. With the Example 1 Worksheet active, go to Tools>Macro>Macros… 10. This will open the Marco dialog, with the Macro named ExportSelectionArea_To_Msta

selected, click the Run button

11. This will open the MicroStation Table Utility dialog, allowing you to select the range or ranges to

export into a MicroStation DGN file. There are two types of ranges you can select, Column Titles and Table Data. In MicroStation, Column Titles are a Height of 8.75 and Weight of 2, while Table Data is a Height of 7 and Weight of 1. This is how you define which text is which.

Note You can select multiple ranges to export to MicroStation by holding down the Control key

when selecting additional Cells in the Excel file.

Page 9: Exporting Excel data - Welcome to the LA-OCMUG · PDF filethat contains the latest updates. ... This will fix the DLL file problem. ... Before you start exporting Excel data into MicroStation,

Exporting Excel data to MicroStation

9 Copyright © 2010 California Department of Transportation 5/10/2010

12. Select the Excel Cells A1 to J2. These Cells are the Column Titles and will be a Height of 8.75 and Weight of 2 when placed in the MicroStation DGN file.

13. Once you have selected the range of Cells A1 to J2 you will see the results in the MicroStation

Table Utility dialog.

14. Next you will select the Table Data to export. Click on the Range(s) of Table Data radio button.

Page 10: Exporting Excel data - Welcome to the LA-OCMUG · PDF filethat contains the latest updates. ... This will fix the DLL file problem. ... Before you start exporting Excel data into MicroStation,

Exporting Excel data to MicroStation

10 Copyright © 2006 California Department of Transportation 5/10/2010

15. Now select the range of Cells that represent the Table Data, cells A3 to J10. You will the range displayed in the Table Data field on the MicroStation Table Utility dialog.

16. To export, click the OK button. Nothing will happen in the Excel file, you will need to switch to the MicroStation DGN file you currently have open. You can switch between Programs from the Windows Task Bar at the bottom of your screen.

17. After you have switched back to MicroStation you will see a rectangle attached to your cursor on the screen. This rectangle is the Excel Table waiting for you to place it in your file. Data Point (left click) to place the Table.

Page 11: Exporting Excel data - Welcome to the LA-OCMUG · PDF filethat contains the latest updates. ... This will fix the DLL file problem. ... Before you start exporting Excel data into MicroStation,

Exporting Excel data to MicroStation

11 Copyright © 2010 California Department of Transportation 5/10/2010

18. The Excel Data should be placed as MicroStation elements in your DGN file.

19. This completes the Exercise for importing Excel data into MicroStation.

Note: The elements that represent the Table were created as a Graphic Group. To move them as one element, turn on the Graphic Group lock located on the Status Bar, it’s the black lock.

Page 12: Exporting Excel data - Welcome to the LA-OCMUG · PDF filethat contains the latest updates. ... This will fix the DLL file problem. ... Before you start exporting Excel data into MicroStation,

Appendix

12 Copyright © 2006 California Department of Transportation 5/10/2010

APPENDIX

THINGS TO CONSIDER: 1. The VBA (Macro) will adjust the Column Widths and Heights based on text in the Cell. 2. In Excel, for Column Titles placed at 90 degrees (vertical) – one must use "Alt-Enter" keys to start

a new line of text within the same column – the program uses the character placed by “Alt-Enter” in the Column Title to determine the number of lines of text in the title.

3. Be careful if you are using Merged Cells in Microsoft Excel. You might not get the results you expect.

4. The Table that gets placed contains MicroStation elements that can be edited as needed, providing the edits are consistent with Caltrans standards.

5. This is a one–way trip for the Excel Data; the Data in the Excel file will not be “linked” to the Data in the MicroStation DGN file. You might want to have a plan to make the Data in the Excel file the master, only making numeric or value changes in the Excel file and then re-exporting the Data to MicroStation. Avoid making changes to both the MicroStation elements and different changes to the Excel file, this could result in mistakes.